[][src]Trait ipfs_embed::ReadonlyStore

pub trait ReadonlyStore: Clone {
    fn get(
        &'a self,
        cid: &'a CidGeneric<Codec, Code>
    ) -> Pin<Box<dyn Future<Output = Result<Box<[u8]>, StoreError>> + 'a + Send>>; }

Implementable by ipld storage providers.

Required methods

fn get(
    &'a self,
    cid: &'a CidGeneric<Codec, Code>
) -> Pin<Box<dyn Future<Output = Result<Box<[u8]>, StoreError>> + 'a + Send>>

Returns a block from the store. If the block is not in the store it fetches it from the network and pins the block. This future should be wrapped in a timeout. Dropping the future cancels the request.

Loading content...

Implementations on Foreign Types

impl ReadonlyStore for MemStore[src]

Loading content...

Implementors

impl ReadonlyStore for Store[src]

Loading content...