Trait iroh_bytes::store::Map
source · pub trait Map: Clone + Send + Sync + 'static {
type Outboard: Outboard;
type DataReader: AsyncSliceReader;
type Entry: MapEntry<Self>;
// Required method
fn get(&self, hash: &Hash) -> Option<Self::Entry>;
}Expand description
A generic collection of blobs with precomputed outboards
Required Associated Types§
sourcetype Outboard: Outboard
type Outboard: Outboard
The outboard type. This can be an in memory outboard or an outboard that retrieves the data asynchronously from a remote database.
sourcetype DataReader: AsyncSliceReader
type DataReader: AsyncSliceReader
The reader type.
Required Methods§
sourcefn get(&self, hash: &Hash) -> Option<Self::Entry>
fn get(&self, hash: &Hash) -> Option<Self::Entry>
Get an entry for a hash.
This can also be used for a membership test by just checking if there is an entry. Creating an entry should be cheap, any expensive ops should be deferred to the creation of the actual readers.
It is not guaranteed that the entry is complete. A PartialMap would return here both complete and partial entries, so that you can share partial entries.
This function should not block to perform io. The knowledge about existing entries must be present in memory.
Object Safety§
This trait is not object safe.