Batching
Lens currently accepts at most one operation per batch.
Batch is an operation builder with put, delete, operations, deduplicated and validate. Its ability to hold many operations does not mean the database commits them atomically.
Lens::batch(&batch).await validates the configured maximum size, then rejects any batch with more than one operation using multi-operation atomic Lens batches are not implemented; refusing partial publication. Empty and single-operation batches follow the implemented path. deduplicated() returns a last-operation-per-key view without mutating the batch passed to Lens.
use lens::{Batch, Lens};
async fn set_theme(lens: &Lens) -> lens::Result<()> {
let mut batch = Batch::new();
batch.put(b"theme".to_vec(), b"dark".to_vec());
lens.batch(&batch).await
}Sequential put calls are individual writes and can leave partial application state if a later call fails. A check-then-put sequence is not a general distributed claim or transaction.