Trait iroh_blobs::store::MapMut
source · pub trait MapMut: Map {
type EntryMut: MapEntryMut;
// Required methods
fn get_mut(
&self,
hash: &Hash
) -> impl Future<Output = Result<Option<Self::EntryMut>>> + Send;
fn get_or_create(
&self,
hash: Hash,
size: u64
) -> impl Future<Output = Result<Self::EntryMut>> + Send;
fn entry_status(
&self,
hash: &Hash
) -> impl Future<Output = Result<EntryStatus>> + Send;
fn entry_status_sync(&self, hash: &Hash) -> Result<EntryStatus>;
fn insert_complete(
&self,
entry: Self::EntryMut
) -> impl Future<Output = Result<()>> + Send;
}
Expand description
A mutable bao map.
This extends the readonly Map
trait with methods to create and modify entries.
Required Associated Types§
sourcetype EntryMut: MapEntryMut
type EntryMut: MapEntryMut
An entry that is possibly writable
Required Methods§
sourcefn get_mut(
&self,
hash: &Hash
) -> impl Future<Output = Result<Option<Self::EntryMut>>> + Send
fn get_mut( &self, hash: &Hash ) -> impl Future<Output = Result<Option<Self::EntryMut>>> + Send
Get an existing entry as an EntryMut.
For implementations where EntryMut and Entry are the same type, this is just an alias for
get
.
sourcefn get_or_create(
&self,
hash: Hash,
size: u64
) -> impl Future<Output = Result<Self::EntryMut>> + Send
fn get_or_create( &self, hash: Hash, size: u64 ) -> impl Future<Output = Result<Self::EntryMut>> + Send
Get an existing partial entry, or create a new one.
We need to know the size of the partial entry. This might produce an error e.g. if there is not enough space on disk.
sourcefn entry_status(
&self,
hash: &Hash
) -> impl Future<Output = Result<EntryStatus>> + Send
fn entry_status( &self, hash: &Hash ) -> impl Future<Output = Result<EntryStatus>> + Send
Find out if the data behind a hash
is complete, partial, or not present.
Note that this does not actually verify the on-disc data, but only checks in which section of the store the entry is present.
sourcefn entry_status_sync(&self, hash: &Hash) -> Result<EntryStatus>
fn entry_status_sync(&self, hash: &Hash) -> Result<EntryStatus>
Sync version of entry_status
, for the doc sync engine until we can get rid of it.
Don’t count on this to be efficient.
Object Safety§
This trait is not object safe.