Weave documentation
Rust referenceweave-lens

weave-lens · block

Source declarations, signatures and documentation for block.

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/block.rs. SHA-256: 1c9b66d47b481dcc7fad39af45f32ff52f9377212b24b4c51391b750a38ebefa.

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.

block::BlockCache

Block cache for efficient node access

pub struct BlockCache {

}

Source line: 10.

block::BlockCache::new

Create a new block cache

pub fn new(capacity: usize) -> Self;

Source line: 20.

block::BlockCache::get

Get a block from cache

pub fn get(&self, index: u64) -> Option<Arc<Node>>;

Source line: 29.

block::BlockCache::put

Put a block in cache

pub fn put(&self, index: u64, node: Arc<Node>);

Source line: 43.

block::BlockCache::clear

Clear the cache

pub fn clear(&self);

Source line: 54.

block::BlockCache::stats

Get cache statistics

pub fn stats(&self) -> CacheStats;

Source line: 63.

block::BlockCache::len

Get current cache size

pub fn len(&self) -> usize;

Source line: 68.

block::BlockCache::is_empty

Check if cache is empty

pub fn is_empty(&self) -> bool;

Source line: 73.

block::CacheStats

Cache statistics

#[derive(Debug, Clone, Default)]
pub struct CacheStats {
/// Number of cache hits

pub hits: u64,
/// Number of cache misses

pub misses: u64,
/// Number of puts

pub puts: u64,
/// Number of evictions

pub evictions: u64,
/// Number of clears

pub clears: u64
}

Source line: 80.

block::CacheStats::hit_ratio

Calculate hit ratio

pub fn hit_ratio(&self) -> f64;

Source line: 99.

pub use crate::node::BlockPointer;

Re-export BlockPointer from node module

pub use crate::node::BlockPointer;

Source line: 110.

On this page