[−][src]Trait ipld_blockstore::BlockStore
Wrapper for database to handle inserting and retrieving ipld data with Cids
Provided methods
pub fn get_bytes(&self, cid: &Cid) -> Result<Option<Vec<u8>>, Box<dyn StdError>>
[src]
Get bytes from block store by Cid.
pub fn get<T>(&self, cid: &Cid) -> Result<Option<T>, Box<dyn StdError>> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
Get typed object from block store by Cid.
pub fn put<S>(&self, obj: &S, code: Code) -> Result<Cid, Box<dyn StdError>> where
S: Serialize,
[src]
S: Serialize,
Put an object in the block store and return the Cid identifier.
pub fn put_raw(
&self,
bytes: Vec<u8>,
code: Code
) -> Result<Cid, Box<dyn StdError>>
[src]
&self,
bytes: Vec<u8>,
code: Code
) -> Result<Cid, Box<dyn StdError>>
Put raw bytes in the block store and return the Cid identifier.
pub fn bulk_put<'a, S, V>(
&self,
values: V,
code: Code
) -> Result<Vec<Cid>, Box<dyn StdError>> where
S: Serialize + 'a,
V: IntoIterator<Item = &'a S>,
[src]
&self,
values: V,
code: Code
) -> Result<Vec<Cid>, Box<dyn StdError>> where
S: Serialize + 'a,
V: IntoIterator<Item = &'a S>,
Batch put cbor objects into blockstore and returns vector of Cids