pub struct DocWriteExecutor { /* private fields */ }Expand description
将 crate::DocBuilder 渲染为物理 DOCX 文件的执行器。
包装 docx-rs 进行实际的 OOXML 生成。
Implementations§
Source§impl DocWriteExecutor
impl DocWriteExecutor
Sourcepub fn save(self) -> Result<()>
pub fn save(self) -> Result<()>
Saves the assembled document to disk.
§Errors
Returns an I/O or ZIP error if the file cannot be written.
Sourcepub fn save_to_writer<W: Write + Seek>(self, writer: W) -> Result<()>
pub fn save_to_writer<W: Write + Seek>(self, writer: W) -> Result<()>
Writes the assembled document to a generic writer.
Corresponds to Hutool’s Word07Writer.flush(OutputStream).
The writer must implement both Write and Seek (required by docx-rs).
§Errors
Returns an I/O or ZIP error.
Sourcepub fn save_to_bytes(self) -> Result<Vec<u8>>
pub fn save_to_bytes(self) -> Result<Vec<u8>>
Writes the assembled document to a Vec<u8> buffer.
Auto Trait Implementations§
impl Freeze for DocWriteExecutor
impl RefUnwindSafe for DocWriteExecutor
impl Send for DocWriteExecutor
impl Sync for DocWriteExecutor
impl Unpin for DocWriteExecutor
impl UnsafeUnpin for DocWriteExecutor
impl UnwindSafe for DocWriteExecutor
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