Skip to main content

Crate do_memory_storage_redb

Crate do_memory_storage_redb 

Source
Expand description

§Memory Storage - redb

redb embedded database for fast cache layer.

This crate provides:

  • High-performance key-value storage using redb
  • Zero-copy reads for fast retrieval
  • Async wrappers for synchronous redb operations
  • Episode and pattern caching
  • Bincode serialization for efficient storage

§Example

use do_memory_storage_redb::RedbStorage;
use std::path::Path;

let storage = RedbStorage::new(Path::new("./memory.redb")).await?;

Structs§

AdaptiveCache
Adaptive LRU cache with intelligent TTL adjustment
AdaptiveCacheAdapter
Adapter that wraps AdaptiveCache for metadata-only caching.
AdaptiveCacheConfig
Configuration for adaptive TTL cache
AdaptiveCacheMetrics
Metrics specific to adaptive cache performance
CacheConfig
Configuration for the LRU cache
CacheMetrics
Cache performance metrics
CachePersistence
Cache persistence handler
CacheSnapshot
Complete cache snapshot
IncrementalUpdate
Incremental update record
LRUCache
LRU cache with TTL expiration
PersistedCacheEntry
A single persisted cache entry
PersistenceConfig
Configuration for cache persistence
PersistenceManager
Manager for automatic cache persistence
PersistenceStats
Persistence statistics
RedbQuery
Query options for episodes
RedbStorage
redb storage backend for fast caching
StorageStatistics
Storage statistics

Enums§

PersistenceMode
Persistence mode
PersistenceStrategy
Persistence strategy

Constants§

MAX_EMBEDDING_SIZE
Maximum size for embedding deserialization (1MB).
MAX_EPISODE_SIZE
Maximum size for episode deserialization (10MB).
MAX_HEURISTIC_SIZE
Maximum size for heuristic deserialization (100KB).
MAX_PATTERN_SIZE
Maximum size for pattern deserialization (1MB).

Traits§

Cache
Common cache trait for metadata tracking