Trait iroh_blobs::store::MapEntry

source ·
pub trait MapEntry: Debug + Clone + Send + Sync + 'static {
    // Required methods
    fn hash(&self) -> Hash;
    fn size(&self) -> BaoBlobSize;
    fn is_complete(&self) -> bool;
    fn outboard(&self) -> impl Future<Output = Result<impl Outboard>> + Send;
    fn data_reader(
        &self
    ) -> impl Future<Output = Result<impl AsyncSliceReader>> + Send;
}
Expand description

An entry for one hash in a bao map

The entry has the ability to provide you with an (outboard, data) reader pair. Creating the reader is async and may fail. The futures that create the readers must be Send, but the readers themselves don’t have to be.

Required Methods§

source

fn hash(&self) -> Hash

The hash of the entry.

source

fn size(&self) -> BaoBlobSize

The size of the entry.

source

fn is_complete(&self) -> bool

Returns true if the entry is complete.

Note that this does not actually verify if the bytes on disk are complete, it only checks if the entry was marked as complete in the store.

source

fn outboard(&self) -> impl Future<Output = Result<impl Outboard>> + Send

A future that resolves to a reader that can be used to read the outboard

source

fn data_reader( &self ) -> impl Future<Output = Result<impl AsyncSliceReader>> + Send

A future that resolves to a reader that can be used to read the data

Object Safety§

This trait is not object safe.

Implementors§

source§

impl MapEntry for iroh_blobs::store::mem::Entry

source§

impl MapEntry for iroh_blobs::store::readonly_mem::Entry

source§

impl MapEntry for iroh_blobs::store::fs::Entry