pub trait BlockStorage: Send + Sync {
// Required methods
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid<64>,
) -> Pin<Box<dyn Future<Output = Result<Block, StorageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn set<'life0, 'async_trait>(
&'life0 self,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<Cid<64>, StorageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid<64>,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn max_block_size(&self) -> usize;
// Provided method
fn stat<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid<64>,
) -> Pin<Box<dyn Future<Output = Result<BlockStat, StorageError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait { ... }
}Required Methods§
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid<64>,
) -> Pin<Box<dyn Future<Output = Result<Block, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid<64>,
) -> Pin<Box<dyn Future<Output = Result<Block, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns a block from storage.
Sourcefn set<'life0, 'async_trait>(
&'life0 self,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<Cid<64>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 self,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<Cid<64>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Inserts a block into storage.
Sourcefn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid<64>,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
cid: &'life1 Cid<64>,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Remove a block.
Sourcefn max_block_size(&self) -> usize
fn max_block_size(&self) -> usize
Maximum accepted block size.