iroh_blobs::store

Trait 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§

Source

type Entry: MapEntry

The entry type. An entry is a cheaply cloneable handle that can be used to open readers for both the data and the outboard

Required Methods§

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Map for iroh_blobs::store::fs::Store

Available on crate feature fs-store only.
Source§

type Entry = BaoFileHandle

Source§

impl Map for iroh_blobs::store::mem::Store

Source§

impl Map for iroh_blobs::store::readonly_mem::Store