dwn-core 0.4.0

Core DWN types.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use xdid::core::did::Did;

use crate::message::data::Data;

use super::StoreError;

/// Maps IPLD hashes to their contents.
pub trait DataStore: Send + Sync {
    fn read(&self, target: &Did, cid: &str) -> Result<Option<Data>, StoreError>;

    /// Adds a reference to a CID.
    fn add_ref(&self, target: &Did, cid: &str, data: Option<Data>) -> Result<(), StoreError>;

    /// Removes a reference to a CID.
    fn remove_ref(&self, target: &Did, cid: &str) -> Result<(), StoreError>;
}