pub struct HwpxDecoder;Expand description
Decodes HWPX files (ZIP + XML) into Core’s Document<Draft>.
§Examples
use hwpforge_smithy_hwpx::HwpxDecoder;
let bytes = std::fs::read("document.hwpx").unwrap();
let result = HwpxDecoder::decode(&bytes).unwrap();
println!("Sections: {}", result.document.sections().len());Implementations§
Source§impl HwpxDecoder
impl HwpxDecoder
Sourcepub fn decode(bytes: &[u8]) -> HwpxResult<HwpxDocument>
pub fn decode(bytes: &[u8]) -> HwpxResult<HwpxDocument>
Decodes an HWPX file from raw bytes.
Pipeline:
- Open ZIP archive, validate mimetype
- Parse
Contents/header.xml→HwpxStyleStore - Parse
Contents/section*.xml→ paragraphs + page settings - Assemble
Document<Draft>with sections
Sourcepub fn decode_file(path: impl AsRef<Path>) -> HwpxResult<HwpxDocument>
pub fn decode_file(path: impl AsRef<Path>) -> HwpxResult<HwpxDocument>
Decodes an HWPX file from a filesystem path.
Auto Trait Implementations§
impl Freeze for HwpxDecoder
impl RefUnwindSafe for HwpxDecoder
impl Send for HwpxDecoder
impl Sync for HwpxDecoder
impl Unpin for HwpxDecoder
impl UnwindSafe for HwpxDecoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more