Trait libipld::cache::Cache[][src]

pub trait Cache<S: Store, C, T> {
    fn get(&self, cid: &Cid, tmp: Option<&S::TempPin>) -> Result<T>;
#[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
;
fn insert(&self, payload: T, tmp: Option<&S::TempPin>) -> Result<Cid>; }

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]

Returns a decoded block from the network.

fn insert(&self, payload: T, tmp: Option<&S::TempPin>) -> Result<Cid>[src]

Encodes and inserts a block.

Loading content...

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]

Loading content...