Weave documentation
Rust referenceweave-lens

weave-lens · sub

Source declarations, signatures and documentation for sub.

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/sub.rs. SHA-256: e693d5e56d793cdf1d77ea0f9072df388117a596477620461d319446284a0ced.

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.

sub::SubOptions

Options for creating a sub-database

#[derive(Debug, Clone)]
pub struct SubOptions {
/// Prefix separator (default: "/")

pub separator: String,
/// Inherit parent configuration

pub inherit_config: bool,
/// Custom cache size for sub-db

pub cache_size: Option<usize>
}

Source line: 8.

sub::SubDatabase

A sub-database with a key prefix

pub struct SubDatabase {

}

Source line: 30.

sub::SubDatabase::new

Create a new sub-database

pub fn new(parent: Arc<Lens>, prefix: Vec<u8>, options: SubOptions) -> Self;

Source line: 43.

sub::SubDatabase::put

Put a value in the sub-database

pub async fn put(&self, key: &[u8], value: &[u8]) -> Result<()>;

Source line: 62.

sub::SubDatabase::get

Get a value from the sub-database

pub async fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>;

Source line: 68.

sub::SubDatabase::delete

Delete a key from the sub-database

pub async fn delete(&self, key: &[u8]) -> Result<()>;

Source line: 74.

sub::SubDatabase::exists

Check if key exists in sub-database

pub async fn exists(&self, key: &[u8]) -> Result<bool>;

Source line: 80.

sub::SubDatabase::sub

Create a nested sub-database

pub fn sub(&self, name: &str) -> SubDatabase;

Source line: 86.

On this page