Weave documentation
Rust referenceweave-lens

weave-lens · batch

Source declarations, signatures and documentation for batch.

Reviewed implementation boundary: The current batching helper rejects multiple operations instead of implementing atomic batch commits. Cache/compaction/retention configuration fields do not establish running background compaction. See /libraries/lens/overview.

Source: sigil/weave/models/lens/src/batch.rs. SHA-256: 44564973e8250d602a7924e2a0a070dfa7ec9379313d90d8f118563f41ff4794.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

batch::BatchOp

Batch operation type

#[derive(Debug, Clone)]
pub enum BatchOp {
    /// Put a key-value pair
    Put(Key, Value),

    /// Delete a key
    Delete(Key),
}

Source line: 8.

batch::Batch

Batch of operations to apply atomically

#[derive(Debug, Default)]
pub struct Batch {

}

Source line: 18.

batch::Batch::new

Create a new empty batch

pub fn new() -> Self;

Source line: 28.

batch::Batch::put

Add a put operation

pub fn put(&mut self, key: impl Into<Vec<u8>>, value: impl Into<Vec<u8>>);

Source line: 36.

batch::Batch::delete

Add a delete operation

pub fn delete(&mut self, key: impl Into<Vec<u8>>);

Source line: 46.

batch::Batch::len

Get number of operations

pub fn len(&self) -> usize;

Source line: 55.

batch::Batch::is_empty

Check if batch is empty

pub fn is_empty(&self) -> bool;

Source line: 60.

batch::Batch::clear

Clear all operations

pub fn clear(&mut self);

Source line: 65.

batch::Batch::operations

Get operations in order

pub fn operations(&self) -> &[BatchOp];

Source line: 71.

batch::Batch::deduplicated

Get deduplicated operations

pub fn deduplicated(&self) -> Vec<&BatchOp>;

Source line: 76.

batch::Batch::validate

Validate batch size

pub fn validate(&self, max_size: usize) -> Result<()>;

Source line: 81.

On this page