[][src]Trait libp2p_bitswap::BitswapStore

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

Bitswap store abstraction.

Required methods

pub fn contains(&self, cid: &Cid) -> bool[src]

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

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

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

pub fn insert(&self, cid: Cid, data: Vec<u8>)[src]

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

Loading content...

Implementors

Loading content...