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§
sourcefn size(&self) -> BaoBlobSize
fn size(&self) -> BaoBlobSize
The size of the entry.
sourcefn is_complete(&self) -> bool
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.
sourcefn outboard(&self) -> impl Future<Output = Result<impl Outboard>> + Send
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
sourcefn data_reader(
&self
) -> impl Future<Output = Result<impl AsyncSliceReader>> + Send
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.