pub trait ObjectSource {
// Required methods
fn get_tree(&self, hash: &ContentHash) -> Result<Option<Tree>, HeddleError>;
fn get_state(&self, id: &StateId) -> Result<Option<State>, HeddleError>;
fn get_blob(&self, hash: &ContentHash) -> Result<Option<Blob>, HeddleError>;
// Provided method
fn get_blob_bytes(
&self,
hash: &ContentHash,
) -> Result<Option<Bytes>, HeddleError> { ... }
}Expand description
Read-only object access needed by object graph walkers.
Required Methods§
fn get_tree(&self, hash: &ContentHash) -> Result<Option<Tree>, HeddleError>
fn get_state(&self, id: &StateId) -> Result<Option<State>, HeddleError>
fn get_blob(&self, hash: &ContentHash) -> Result<Option<Blob>, HeddleError>
Provided Methods§
Sourcefn get_blob_bytes(
&self,
hash: &ContentHash,
) -> Result<Option<Bytes>, HeddleError>
fn get_blob_bytes( &self, hash: &ContentHash, ) -> Result<Option<Bytes>, HeddleError>
Zero-copy variant of get_blob.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".