[][src]Trait ipld_block_builder::store::Store

pub trait Store: 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 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 a block into the store and announces the block if it is visible.

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>>

Marks a block ready for garbage collection.

Loading content...

Implementors

impl Store for MemStore[src]

Loading content...