| Crates.io | safe-map-cache |
| lib.rs | safe-map-cache |
| version | 0.1.0 |
| created_at | 2025-12-31 14:36:43.372071+00 |
| updated_at | 2025-12-31 14:36:43.372071+00 |
| description | A safe, concurrent memory-mapped LRU cache with a persisted on-disk index and compaction. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2014815 |
| size | 77,026 |
A safe, concurrent memory-mapped LRU cache with a persisted on-disk index and optional strict validation mode for debugging and tests.
Features
Quick start
use safe_map_cache::{Config, SafeMmapCache};
use tempfile::NamedTempFile;
let tmp = NamedTempFile::new().unwrap();
let cfg = Config {
path: tmp.path().to_path_buf(),
index_capacity: 512,
free_capacity: 512,
initial_file_size: 8 * 1024 * 1024,
strict_validations: false,
};
let cache = SafeMmapCache::open(cfg).unwrap();
cache.put(1, b"one").unwrap();
assert_eq!(cache.get(1).unwrap(), Some(b"one".to_vec()));
Fuzzing & testing
tests/fuzz_like.rs deterministic fuzz-like harness used in CIfuzz/ folder contains a cargo-fuzz target (fuzz_ops) for deeper fuzzingLicense & Contributing
LICENSE)