Skip to main content

Module store

Module store 

Source
Expand description

Slab storage traits for instance-based (non-ZST) slabs.

Single trait hierarchy: SlabStore provides allocation and deallocation. BoundedStore extends it with fallible allocation for callers who want graceful error handling.

§Allocation and OOM

SlabStore::alloc always returns a valid slot. For unbounded slabs this is guaranteed by growth. For bounded slabs, exceeding capacity panics.

This is a deliberate design choice: bounded capacity is a deployment constraint, not a runtime negotiation. If you hit the limit, your capacity planning is wrong and the system should fail loudly — the same way a process panics on OOM. Silently dropping timers or events is worse than crashing.

Use BoundedStore::try_alloc if you need graceful error handling at specific call sites.

Structs§

BoundedSlab
Fixed-capacity slab allocator.
UnboundedSlab
Growable slab allocator.

Traits§

BoundedStore
Bounded (fixed-capacity) storage — provides fallible allocation.
SlabStore
Base trait for slab storage — allocation, deallocation, and value extraction.