DataStore

Trait DataStore 

Source
pub trait DataStore: Send + Sync {
    // Required methods
    fn read(&self, target: &Did, cid: &str) -> Result<Option<Data>, StoreError>;
    fn add_ref(
        &self,
        target: &Did,
        cid: &str,
        data: Option<Data>,
    ) -> Result<(), StoreError>;
    fn remove_ref(&self, target: &Did, cid: &str) -> Result<(), StoreError>;
}
Expand description

Maps IPLD hashes to their contents.

Required Methods§

Source

fn read(&self, target: &Did, cid: &str) -> Result<Option<Data>, StoreError>

Source

fn add_ref( &self, target: &Did, cid: &str, data: Option<Data>, ) -> Result<(), StoreError>

Adds a reference to a CID.

Source

fn remove_ref(&self, target: &Did, cid: &str) -> Result<(), StoreError>

Removes a reference to a CID.

Implementors§