Trait SimplifiedBatch

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

    // Required methods
    fn from_batch<S: DeletePrefixExpander>(
        store: S,
        batch: Batch,
    ) -> impl Future<Output = Result<Self, S::Error>> + Send + Sync;
    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<S: DeletePrefixExpander>( store: S, batch: Batch, ) -> impl Future<Output = Result<Self, S::Error>> + Send + Sync

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§