[][src]Trait ipld_block_builder::Cache

pub trait Cache<C, T>: ReadonlyCache<C, T> where
    C: Decoder + Encoder + Clone + Send + Sync,
    T: Decode<<C as Decoder>::Codec> + Encode<<C as Encoder>::Codec> + Clone + Send + Sync
{ fn create_batch(&self) -> CacheBatch<C, T>;
fn create_batch_with_capacity(&self, capacity: usize) -> CacheBatch<C, T>;
#[must_use] fn insert_batch<'life0, 'async_trait>(
        &'life0 self,
        batch: CacheBatch<C, T>
    ) -> Pin<Box<dyn Future<Output = Result<Cid>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn insert<'life0, 'async_trait>(
        &'life0 self,
        value: T
    ) -> Pin<Box<dyn Future<Output = Result<Cid>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn flush<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn unpin<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cid: &'life1 Cid
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

Cache trait.

Required methods

fn create_batch(&self) -> CacheBatch<C, T>

Creates a typed batch.

fn create_batch_with_capacity(&self, capacity: usize) -> CacheBatch<C, T>

Creates a typed batch.

#[must_use]fn insert_batch<'life0, 'async_trait>(
    &'life0 self,
    batch: CacheBatch<C, T>
) -> Pin<Box<dyn Future<Output = Result<Cid>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Inserts a batch into the store.

#[must_use]fn insert<'life0, 'async_trait>(
    &'life0 self,
    value: T
) -> Pin<Box<dyn Future<Output = Result<Cid>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Encodes and inserts a block.

#[must_use]fn flush<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Flushes all buffers.

#[must_use]fn unpin<'life0, 'life1, 'async_trait>(
    &'life0 self,
    cid: &'life1 Cid
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Unpins a block.

Loading content...

Implementors

impl<S: Store + Send + Sync, C, T> Cache<C, T> for IpldCache<S, C, T> where
    C: Decoder + Encoder + Clone + Send + Sync,
    T: Decode<<C as Decoder>::Codec> + Encode<<C as Encoder>::Codec> + Clone + Send + Sync
[src]

Loading content...