Skip to main content

Module resources

Module resources 

Source
Expand description

Shared managed-byte accounting. Reservations are ownership tokens, not allocations, an RSS limit, or a substitute for charging each consumer.

Structs§

BudgetSnapshot
Point-in-time usage of one budget: configured limit, current and peak use.
ByteBudget
Child usage is included in every ancestor; creating children does not multiply the parent limit. Names are static component names, not tenant identifiers or unbounded metric labels. Dropping the last child handle and reservation releases its metadata without retaining a central registry.
ByteReservation
Not Clone: exactly one owner releases each charge, including during unwind. Move this with the allocated buffer; do not drop it while retaining data.
FairAdmission
Bounded fair admission gate: serializes requests for bytes from a budget and admits them in arrival order when capacity frees up, honoring a caller deadline and an external cancellation flag. try_reserve remains the non-blocking primitive; this adds bounded queueing, deadlines, and cancellation for work that must wait rather than fail immediately (e.g. group-commit staging, transaction buffers).
StorageResources
Initial embedded storage configuration, not a whole-process RSS promise.

Enums§

AdmissionError
Admission error for a FairAdmission::acquire attempt. A successful call returns the owned ByteReservation; failure returns one of these without charging bytes.
Durability
Logical durability contract (research D10). Local is the default and guarantees the commit is durable on this node before it is acknowledged. Async does not fsync: with redb 4.x the commit is not persisted until a later Local commit or checkpoint, so an acknowledged Async commit can be lost on a crash, power loss, or hard kill. It is intended only for re-importable bulk input, not as a weaker consistency mode. Memory is only meaningful for in-memory stores.
ResourceError
Errors from managed-byte accounting: invalid budgets, exhausted limits, and reservation ownership violations.

Functions§

physical_shard_for
Deterministic tenant → physical shard mapping. Uses a fixed-width FNV-1a over the 32-byte tenant id so routing is restart-stable and independent of the in-memory admission-shard count. Commits without a tenant route to shard 0.