Trait iroh_blobs::store::Map
source · pub trait Map: Clone + Send + Sync + 'static {
type Entry: MapEntry;
// Required method
fn get(
&self,
hash: &Hash
) -> impl Future<Output = Result<Option<Self::Entry>>> + Send;
}
Expand description
A generic map from hashes to bao blobs (blobs with bao outboards).
This is the readonly view. To allow updates, a concrete implementation must
also implement MapMut
.
Entries are not guaranteed to be complete for all implementations. They are also not guaranteed to be immutable, since this could be the readonly view of a mutable store.
Required Associated Types§
Required Methods§
sourcefn get(
&self,
hash: &Hash
) -> impl Future<Output = Result<Option<Self::Entry>>> + Send
fn get( &self, hash: &Hash ) -> impl Future<Output = Result<Option<Self::Entry>>> + Send
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.
Object Safety§
This trait is not object safe.