[−][src]Trait ipfs_embed::ReadonlyStore
Implementable by ipld storage providers.
Associated Types
type Multihash: MultihashDigest
The multihash type of the store.
type Codec: Codec
The codec type of the store.
Associated Constants
const MAX_BLOCK_SIZE: usize
The maximum block size supported by the store.
Required methods
fn get(
&'a self,
cid: Cid
) -> Pin<Box<dyn Future<Output = Result<Block<Self::Codec, Self::Multihash>, Error>> + 'a + Send>>
&'a self,
cid: Cid
) -> Pin<Box<dyn Future<Output = Result<Block<Self::Codec, Self::Multihash>, Error>> + '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. Dropping the future cancels the request.
If the block wasn't found it returns a BlockNotFound
error.
Provided methods
fn get_ipld(
&'a self,
cid: &'a Cid
) -> Pin<Box<dyn Future<Output = Result<Ipld, Error>> + 'a + Send>>
&'a self,
cid: &'a Cid
) -> Pin<Box<dyn Future<Output = Result<Ipld, Error>> + 'a + Send>>
Returns the ipld representation of a block with cid.
fn get_path(
&'a self,
path: &'a DagPath<'a>
) -> Pin<Box<dyn Future<Output = Result<Ipld, Error>> + 'a + Send>>
&'a self,
path: &'a DagPath<'a>
) -> Pin<Box<dyn Future<Output = Result<Ipld, Error>> + 'a + Send>>
Resolves a path recursively and returns the ipld.
Implementations on Foreign Types
impl<C, M> ReadonlyStore for MemStore<C, M> where
C: Codec,
M: MultihashDigest,
[src]
C: Codec,
M: MultihashDigest,
type Codec = C
type Multihash = M
const MAX_BLOCK_SIZE: usize
[src]
fn get(
&'a self,
cid: Cid
) -> Pin<Box<dyn Future<Output = Result<Block<C, M>, Error>> + 'a + Send>>
[src]
&'a self,
cid: Cid
) -> Pin<Box<dyn Future<Output = Result<Block<C, M>, Error>> + 'a + Send>>