Struct rust_ipfs::repo::mem::MemBlockStore
source · pub struct MemBlockStore { /* private fields */ }
Expand description
Describes an in-memory block store.
Blocks are stored as a HashMap
of the Cid
and Block
.
Implementations§
Trait Implementations§
source§impl BlockStore for MemBlockStore
impl BlockStore for MemBlockStore
fn init<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn open<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
FIXME: redundant and never called during initialization, which is expected to happen during [
init
].source§fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains<'life0, 'life1, 'async_trait>( &'life0 self, cid: &'life1 Cid ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Returns whether a block is present in the blockstore.
source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid
) -> Pin<Box<dyn Future<Output = Result<Option<Block>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>( &'life0 self, cid: &'life1 Cid ) -> Pin<Box<dyn Future<Output = Result<Option<Block>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Returns a block from the blockstore.
source§fn put<'life0, 'async_trait>(
&'life0 self,
block: Block
) -> Pin<Box<dyn Future<Output = Result<(Cid, BlockPut), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>( &'life0 self, block: Block ) -> Pin<Box<dyn Future<Output = Result<(Cid, BlockPut), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Inserts a block in the blockstore.
source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid
) -> Pin<Box<dyn Future<Output = Result<Result<BlockRm, BlockRmError>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>( &'life0 self, cid: &'life1 Cid ) -> Pin<Box<dyn Future<Output = Result<Result<BlockRm, BlockRmError>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Removes a block from the blockstore.
source§impl Debug for MemBlockStore
impl Debug for MemBlockStore
source§impl Default for MemBlockStore
impl Default for MemBlockStore
source§fn default() -> MemBlockStore
fn default() -> MemBlockStore
Returns the “default value” for a type. Read more