Skip to main content

BlockstoreExt

Trait BlockstoreExt 

Source
pub trait BlockstoreExt: Blockstore {
    // Provided methods
    fn bulk_put<'a, S, V>(&self, values: V, code: Code) -> Result<Vec<Cid>>
       where Self: Sized,
             S: Serialize + 'a,
             V: IntoIterator<Item = &'a S> { ... }
    fn get_required(&self, cid: &Cid) -> Result<Vec<u8>> { ... }
}
Expand description

Extension methods for inserting and retrieving IPLD data with CIDs

Provided Methods§

Source

fn bulk_put<'a, S, V>(&self, values: V, code: Code) -> Result<Vec<Cid>>
where Self: Sized, S: Serialize + 'a, V: IntoIterator<Item = &'a S>,

Batch put CBOR objects into block store and returns vector of CIDs

Source

fn get_required(&self, cid: &Cid) -> Result<Vec<u8>>

Gets the block from the blockstore. Return an error when not found.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§