[][src]Trait ipfs_embed_core::Storage

pub trait Storage<S: StoreParams>: Send + Sync + 'static {
    type Subscription: Stream<Item = StorageEvent> + Send + Unpin;
    fn get(&self, cid: &Cid) -> Result<Option<Vec<u8>>>;
fn commit(&self, tx: Transaction<S>) -> Result<()>;
fn contains(&self, cid: &Cid) -> Result<bool>;
fn blocks(&self) -> Result<Vec<(u64, Cid, u64)>>;
fn references(&self, id: u64) -> Result<Vec<(u64, Cid)>>;
fn referrers(&self, id: u64) -> Result<Vec<(u64, Cid)>>;
fn subscribe(&self) -> Self::Subscription; }

Associated Types

Loading content...

Required methods

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

fn commit(&self, tx: Transaction<S>) -> Result<()>

fn contains(&self, cid: &Cid) -> Result<bool>

fn blocks(&self) -> Result<Vec<(u64, Cid, u64)>>

fn references(&self, id: u64) -> Result<Vec<(u64, Cid)>>

fn referrers(&self, id: u64) -> Result<Vec<(u64, Cid)>>

fn subscribe(&self) -> Self::Subscription

Loading content...

Implementors

Loading content...