Trait ipfs_embed_net::BitswapStore[][src]

pub trait BitswapStore: 'static + Send + Sync {
    type Params: StoreParams;
    pub fn contains(
        &mut self,
        cid: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
    ) -> Result<bool, Error>;
pub fn get(
        &mut self,
        cid: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
    ) -> Result<Option<Vec<u8, Global>>, Error>;
pub fn insert(&mut self, block: &Block<Self::Params>) -> Result<(), Error>;
pub fn missing_blocks(
        &mut self,
        cid: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
    ) -> Result<Vec<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, Global>, Error>; }

Trait implemented by a block store.

Associated Types

type Params: StoreParams[src]

The store params.

Loading content...

Required methods

pub fn contains(
    &mut self,
    cid: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
) -> Result<bool, Error>
[src]

A have query needs to know if the block store contains the block.

pub fn get(
    &mut self,
    cid: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
) -> Result<Option<Vec<u8, Global>>, Error>
[src]

A block query needs to retrieve the block from the store.

pub fn insert(&mut self, block: &Block<Self::Params>) -> Result<(), Error>[src]

A block response needs to insert the block into the store.

pub fn missing_blocks(
    &mut self,
    cid: &Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>
) -> Result<Vec<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, Global>, Error>
[src]

A sync query needs a list of missing blocks to make progress.

Loading content...

Implementors

Loading content...