[][src]Trait libipld::store::Store

pub trait Store: ReadonlyStore {
    fn insert<'a>(
        &'a self,
        cid: &'a Cid,
        data: Box<[u8]>,
        visibility: Visibility
    ) -> StoreResult<'a, ()>;
fn insert_batch<'a>(
        &'a self,
        batch: Vec<Block>,
        visibility: Visibility
    ) -> StoreResult<'a, Cid>;
fn flush(&self) -> StoreResult<()>;
fn unpin<'a>(&'a self, cid: &'a Cid) -> StoreResult<'a, ()>; }

Implementable by ipld storage backends.

Required methods

fn insert<'a>(
    &'a self,
    cid: &'a Cid,
    data: Box<[u8]>,
    visibility: Visibility
) -> StoreResult<'a, ()>

Inserts and pins block into the store and announces it if it is visible.

fn insert_batch<'a>(
    &'a self,
    batch: Vec<Block>,
    visibility: Visibility
) -> StoreResult<'a, Cid>

Inserts a batch of blocks atomically into the store and announces them block if it is visible. The last block is pinned.

fn flush(&self) -> StoreResult<()>

Flushes the write buffer.

fn unpin<'a>(&'a self, cid: &'a Cid) -> StoreResult<'a, ()>

Decreases the ref count on a cid.

Loading content...

Implementors

impl Store for MemStore[src]

Loading content...