Strategy traits and default implementations for the Mantis SDK.
no_std by default.
Defines the variation points that parameterize all Mantis data structures:
IndexStrategy— how indices wrap around buffer capacityPushPolicy— what to do when the queue is fullInstrumentation— measurement hooks for push/pop operations
| Type | Trait | Behavior |
|---|---|---|
Pow2Masked |
IndexStrategy |
Bitwise AND mask (requires power-of-2 capacity) |
ImmediatePush |
PushPolicy |
Returns Err(Full) immediately |
NoInstr |
Instrumentation |
No-op, zero overhead |
CountingInstr |
Instrumentation |
Atomic counters for push/pop/full/empty |
use mantis_core::{IndexStrategy, Pow2Masked};
let wrapped = Pow2Masked::wrap(1025, 1024); // -> 1Typically used indirectly through mantis-queue preset types.