pub struct HashMapBlockStorage { /* private fields */ }
Expand description
Store with a HashMap backend
Implementations§
Source§impl HashMapBlockStorage
impl HashMapBlockStorage
pub fn new() -> HashMapBlockStorage
pub async fn from_block_stream( overlay: &OverlayId, blockstream: UnboundedReceiver<Block>, ) -> Self
pub fn get_len(&self) -> usize
pub fn get_all(&self) -> Vec<Block>
pub fn put_local(&self, block: &Block) -> Result<BlockId, StorageError>
Trait Implementations§
Source§impl BlockStorage for HashMapBlockStorage
impl BlockStorage for HashMapBlockStorage
Source§fn get(&self, _overlay: &OverlayId, id: &BlockId) -> Result<Block, StorageError>
fn get(&self, _overlay: &OverlayId, id: &BlockId) -> Result<Block, StorageError>
Load a block from the storage.
fn has(&self, _overlay: &OverlayId, id: &BlockId) -> Result<(), StorageError>
Auto Trait Implementations§
impl !Freeze for HashMapBlockStorage
impl RefUnwindSafe for HashMapBlockStorage
impl Send for HashMapBlockStorage
impl Sync for HashMapBlockStorage
impl Unpin for HashMapBlockStorage
impl UnwindSafe for HashMapBlockStorage
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