[][src]Trait ipfs_embed_core::BitswapStore

pub trait BitswapStore<P>: 'static + Send + Sync where
    P: StoreParams
{ fn contains(&self, cid: &Cid) -> bool;
fn get(&self, cid: &Cid) -> Option<Vec<u8>>;
fn insert(&self, cid: Cid, data: Vec<u8>); }

Bitswap store abstraction.

Required methods

fn contains(&self, cid: &Cid) -> bool

Does the store contain a cid. Used for replying to have requests.

fn get(&self, cid: &Cid) -> Option<Vec<u8>>

The data matching a cid. Used for replying to block requests.

fn insert(&self, cid: Cid, data: Vec<u8>)

Insert a block into the store. Used when receiving a block response.

Loading content...

Implementors

impl<S: StoreParams, T: Storage<S>> BitswapStore<S> for BitswapStorage<S, T>[src]

Loading content...