Weave documentation
Rust referencestrand-blobs

strand-blobs · cache

Source declarations, signatures and documentation for cache.

Reviewed implementation boundary: The current GC path quarantines records without reclaiming their stored files. Check actual writer/list/report interfaces and partial-write behavior in /libraries/strand-blobs/overview.

Source: sigil/weave/models/strand-blobs/src/cache.rs. SHA-256: 30530429d98e48c32ad034c1260f09c8aaf584b12693c8063d2b6925fa2e25c5.

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.

cache::ChunkCache

Thread-safe LRU cache for chunks

pub struct ChunkCache {

}

Source line: 11.

cache::ChunkCache::new

Create a new chunk cache with the specified maximum size in bytes

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

Source line: 21.

cache::ChunkCache::get

Get a chunk from the cache

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

Source line: 36.

cache::ChunkCache::insert

Insert a chunk into the cache

pub fn insert(&self, index: u64, data: Bytes);

Source line: 47.

cache::ChunkCache::clear

Clear the cache

pub fn clear(&self);

Source line: 69.

cache::ChunkCache::size

Get current cache size in bytes

pub fn size(&self) -> usize;

Source line: 75.

cache::ChunkCache::len

Get number of cached chunks

pub fn len(&self) -> usize;

Source line: 80.

cache::ChunkCache::is_empty

Check if cache is empty

pub fn is_empty(&self) -> bool;

Source line: 85.

cache::ChunkCache::hits

Cache hit count

pub fn hits(&self) -> u64;

Source line: 90.

cache::ChunkCache::misses

Cache miss count

pub fn misses(&self) -> u64;

Source line: 95.

cache::new_cache

Create a new Arc<ChunkCache>

pub fn new_cache(max_size: usize) -> Arc<ChunkCache>;

Source line: 108.

On this page