BitswapStore

Trait BitswapStore 

Source
pub trait BitswapStore<P>:
    Send
    + Sync
    + 'static
where P: StoreParams,
{ // Required methods fn contains( &self, cid: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, ) -> bool; fn get( &self, cid: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, ) -> Option<Vec<u8>>; fn insert( &self, cid: Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, data: Vec<u8>, ); }
Expand description

Bitswap store abstraction.

Required Methods§

Source

fn contains( &self, cid: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, ) -> bool

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

Source

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

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

Source

fn insert( &self, cid: Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, data: Vec<u8>, )

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

Implementors§