Skip to main content

WriteBatchIterator

Trait WriteBatchIterator 

Source
pub trait WriteBatchIterator {
    // Required methods
    fn put(&mut self, key: &[u8], value: &[u8]);
    fn delete(&mut self, key: &[u8]);

    // Provided method
    fn log_data(&mut self, _blob: &[u8]) { ... }
}
Expand description

Receives the puts and deletes of a write batch.

The application must provide an implementation of this trait when iterating the operations within a WriteBatch

Required Methods§

Source

fn put(&mut self, key: &[u8], value: &[u8])

Called with a key and value that were put into the batch.

Source

fn delete(&mut self, key: &[u8])

Called with a key that was deleted from the batch.

Provided Methods§

Source

fn log_data(&mut self, _blob: &[u8])

Called with a blob that was appended by put_log_data.

Log data is interleaved with the puts and deletes in insertion order. The default implementation ignores it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§