Trait linera_views::batch::SimplifiedBatch

source ·
pub trait SimplifiedBatch: Sized + Send + Sync {
    type Iter: BatchValueWriter<Self>;

    // Required methods
    fn from_batch<'async_trait, S>(
        store: S,
        batch: Batch,
    ) -> Pin<Box<dyn Future<Output = Result<Self, S::Error>> + Send + 'async_trait>>
       where S: 'async_trait + DeletePrefixExpander + Send + Sync,
             Self: 'async_trait;
    fn into_iter(self) -> Self::Iter;
    fn len(&self) -> usize;
    fn num_bytes(&self) -> usize;
    fn overhead_size(&self) -> usize;
    fn add_delete(&mut self, key: Vec<u8>);
    fn add_insert(&mut self, key: Vec<u8>, value: Vec<u8>);

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A notion of batch useful for certain computations (notably journaling).

Required Associated Types§

source

type Iter: BatchValueWriter<Self>

The iterator type used to process values from the batch.

Required Methods§

source

fn from_batch<'async_trait, S>( store: S, batch: Batch, ) -> Pin<Box<dyn Future<Output = Result<Self, S::Error>> + Send + 'async_trait>>
where S: 'async_trait + DeletePrefixExpander + Send + Sync, Self: 'async_trait,

Creates a simplified batch from a standard one.

source

fn into_iter(self) -> Self::Iter

Returns an owning iterator over the values in the batch.

source

fn len(&self) -> usize

Returns the total number of entries in the batch.

source

fn num_bytes(&self) -> usize

Returns the total number of bytes in the batch.

source

fn overhead_size(&self) -> usize

Returns the overhead size of the batch.

source

fn add_delete(&mut self, key: Vec<u8>)

Adds the deletion of key to the batch.

source

fn add_insert(&mut self, key: Vec<u8>, value: Vec<u8>)

Adds the insertion of a key-value pair to the batch.

Provided Methods§

source

fn is_empty(&self) -> bool

Returns true if the batch is empty.

Object Safety§

This trait is not object safe.

Implementors§