Trait libipld::cache::Cache [−][src]
Cache trait.
Required methods
fn get(&self, cid: &Cid, tmp: Option<&S::TempPin>) -> Result<T>
[src]
Returns a decoded block.
#[must_use]fn fetch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
tmp: Option<&'life2 S::TempPin>
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
cid: &'life1 Cid,
tmp: Option<&'life2 S::TempPin>
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Returns a decoded block from the network.
fn insert(&self, payload: T, tmp: Option<&S::TempPin>) -> Result<Cid>
[src]
Encodes and inserts a block.
Implementors
impl<S, C, T> Cache<S, C, T> for IpldCache<S, C, T> where
S: Store,
<S::Params as StoreParams>::Codecs: Into<C>,
C: Codec + Into<<S::Params as StoreParams>::Codecs>,
T: Decode<C> + Encode<C> + Clone + Send + Sync,
Ipld: References<<S::Params as StoreParams>::Codecs>,
[src]
S: Store,
<S::Params as StoreParams>::Codecs: Into<C>,
C: Codec + Into<<S::Params as StoreParams>::Codecs>,
T: Decode<C> + Encode<C> + Clone + Send + Sync,
Ipld: References<<S::Params as StoreParams>::Codecs>,
fn get(&self, cid: &Cid, tmp: Option<&S::TempPin>) -> Result<T>
[src]
fn fetch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cid: &'life1 Cid,
tmp: Option<&'life2 S::TempPin>
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
cid: &'life1 Cid,
tmp: Option<&'life2 S::TempPin>
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,