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§
Sourcefn fetch(&mut self, id: &Hash) -> Result<Option<Cow<'_, [u8]>>, VerifyError>
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".