Skip to main content

ObjectSource

Trait ObjectSource 

Source
pub trait ObjectSource {
    // Required method
    fn fetch(&mut self, id: &Hash) -> Result<Option<Cow<'_, [u8]>>, VerifyError>;
}
Expand description

Provides a pull-based source for canonical object bytes.

Required Methods§

Source

fn fetch(&mut self, id: &Hash) -> Result<Option<Cow<'_, [u8]>>, VerifyError>

Returns canonical bytes for id, or Ok(None) when it is absent. Implementations MUST NOT use their own identity decision as the verification result; the closure walker always deserializes the bytes and re-derives the object id itself.

§Errors

Returns a source error when the requested object cannot be fetched.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§