Skip to main content

BytesReader

Trait BytesReader 

Source
pub trait BytesReader {
    // Required method
    fn read(&self, input: &[u8], options: &ReaderOptions) -> Result<Document>;

    // Provided method
    fn read_media(
        &self,
        input: &[u8],
        options: &ReaderOptions,
    ) -> Result<(Document, MediaBag)> { ... }
}
Expand description

Parses input bytes in some source format into the document model. The byte-shaped counterpart of Reader, for formats whose wire form is not text — zip containers and the like.

Required Methods§

Source

fn read(&self, input: &[u8], options: &ReaderOptions) -> Result<Document>

Parses input bytes into a document.

§Errors

Propagates any error from parsing the input.

Provided Methods§

Source

fn read_media( &self, input: &[u8], options: &ReaderOptions, ) -> Result<(Document, MediaBag)>

Reads input into a document together with the embedded resources it references. The byte-shaped counterpart of Reader::read_media; the default carries no resources.

§Errors

Propagates any error from parsing the input.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§