Skip to main content

Reader

Trait Reader 

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

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

Parses input text in some source format into the document model.

Required Methods§

Source

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

Parses input text into a document.

§Errors

Propagates any error from parsing the input.

Provided Methods§

Source

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

Reads input into a document together with the embedded resources it references. The default carries no resources; a container format — a notebook with image outputs — overrides this to decode those bytes into the returned MediaBag, and implements read by discarding the bag.

§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§