Skip to main content

BytesWriter

Trait BytesWriter 

Source
pub trait BytesWriter {
    // Required method
    fn write(
        &self,
        document: &Document,
        options: &WriterOptions,
    ) -> Result<Vec<u8>>;
}
Expand description

Renders the document model into some target format’s bytes. The byte-shaped counterpart of Writer, for formats whose output is not text — zip containers and the like.

This trait carries no decoration hooks (templates, table of contents, metadata rendering): a container writer produces a complete document by construction. Hooks are added when a real format needs them.

Required Methods§

Source

fn write(&self, document: &Document, options: &WriterOptions) -> Result<Vec<u8>>

Renders document into this format’s bytes.

§Errors

Propagates any error from rendering the document.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§