[][src]Trait ipfs_embed::WritableStore

pub trait WritableStore: ReadonlyStore {
    fn insert(
        &'a self,
        cid: &'a CidGeneric<Codec, Code>,
        data: Box<[u8]>,
        visibility: Visibility
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + 'a + Send>>;
fn insert_batch(
        &'a self,
        batch: Vec<Block>,
        visibility: Visibility
    ) -> Pin<Box<dyn Future<Output = Result<CidGeneric<Codec, Code>, StoreError>> + 'a + Send>>;
fn flush(
        &self
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send>>;
fn unpin(
        &'a self,
        cid: &'a CidGeneric<Codec, Code>
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + 'a + Send>>; }

Implementable by ipld storage backends.

Required methods

fn insert(
    &'a self,
    cid: &'a CidGeneric<Codec, Code>,
    data: Box<[u8]>,
    visibility: Visibility
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + 'a + Send>>

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

fn insert_batch(
    &'a self,
    batch: Vec<Block>,
    visibility: Visibility
) -> Pin<Box<dyn Future<Output = Result<CidGeneric<Codec, Code>, StoreError>> + 'a + Send>>

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) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send>>

Flushes the write buffer.

fn unpin(
    &'a self,
    cid: &'a CidGeneric<Codec, Code>
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + 'a + Send>>

Decreases the ref count on a cid.

Loading content...

Implementations on Foreign Types

impl Store for MemStore[src]

Loading content...

Implementors

impl Store for Store[src]

Loading content...