pub struct MemoryBlockStore { /* private fields */ }Expand description
In-memory block store using a concurrent hash map
Implementations§
Trait Implementations§
Source§impl BlockStore for MemoryBlockStore
impl BlockStore for MemoryBlockStore
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
block: &'life1 Block,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
block: &'life1 Block,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store a single block
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<Option<Block>>> + 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>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a block by CID
Source§fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a block exists
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a block
Source§fn put_many<'life0, 'life1, 'async_trait>(
&'life0 self,
blocks: &'life1 [Block],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_many<'life0, 'life1, 'async_trait>(
&'life0 self,
blocks: &'life1 [Block],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store multiple blocks atomically
Source§fn get_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Block>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Block>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve multiple blocks
Source§fn has_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<Vec<bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if multiple blocks exist
Source§fn delete_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_many<'life0, 'life1, 'async_trait>(
&'life0 self,
cids: &'life1 [Cid],
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete multiple blocks
Source§impl Clone for MemoryBlockStore
impl Clone for MemoryBlockStore
Source§fn clone(&self) -> MemoryBlockStore
fn clone(&self) -> MemoryBlockStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MemoryBlockStore
impl !RefUnwindSafe for MemoryBlockStore
impl Send for MemoryBlockStore
impl Sync for MemoryBlockStore
impl Unpin for MemoryBlockStore
impl !UnwindSafe for MemoryBlockStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> StreamingBlockStore for Twhere
T: BlockStore,
impl<T> StreamingBlockStore for Twhere
T: BlockStore,
Source§fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
range: ByteRange,
) -> Pin<Box<dyn Future<Output = Result<Option<PartialBlock>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_range<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
range: ByteRange,
) -> Pin<Box<dyn Future<Output = Result<Option<PartialBlock>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read a partial block (range-based) Read more