Skip to main content

ContentSource

Trait ContentSource 

Source
pub trait ContentSource {
    // Required method
    fn content(&self, hash: &str) -> Option<Cow<'_, [u8]>>;
}
Expand description

Read access to content by address, for code that turns documents into something else (an exporter embedding images, a renderer) without doing I/O of its own.

Required Methods§

Source

fn content(&self, hash: &str) -> Option<Cow<'_, [u8]>>

The bytes at hash, if this source has them.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl ContentSource for BTreeMap<String, Vec<u8>>

Source§

fn content(&self, hash: &str) -> Option<Cow<'_, [u8]>>

Source§

impl<A: ContentSource, B: ContentSource> ContentSource for (A, B)

Source§

fn content(&self, hash: &str) -> Option<Cow<'_, [u8]>>

Source§

impl<T: ContentSource + ?Sized> ContentSource for &T

Source§

fn content(&self, hash: &str) -> Option<Cow<'_, [u8]>>

Implementors§