CacheKit Docs

High-performance cache policies and supporting data structures.

View the Project on GitHub OxidizeLabs/cachekit

Slab store

This store module is implemented in cachekit::store::slab and provides a slab-backed store with stable EntryId indirection (useful for policy metadata structures that want stable handles).

Architecture

Key Components

Core Operations

Performance Trade-offs

When to Use

Example Usage

use std::sync::Arc;

use cachekit::store::slab::{SharedSlabStore, SlabStore};
use cachekit::store::traits::StoreMut;

let mut store: SharedSlabStore<u64, String> = SlabStore::new(4);
store.try_insert(1, Arc::new("a".to_string())).unwrap();
let id = store.entry_id(&1).unwrap();
assert_eq!(store.get_by_id(id).as_deref().map(String::as_str), Some("a"));

Type Constraints

Thread Safety

Implementation Notes