rskit-stateful — State Machines and Accumulators
Stateful accumulation primitives with pluggable stores, configurable flush triggers, size limits, TTL expiration, and keyed manager cleanup.
Features
StateMachine<S, C>for guarded typed transitions with audit and persistence hooksTransition<S, C>for named transitions with optional guards and actionsAccumulator<V>for buffered append/flush workflowsAccumulatorConfig<V>with TTL, keep-alive, max-size, triggers, and custom measurersTrigger<V>implementations for size, byte-size, and time-based flushesMemoryStore<V>plus aStore<V>trait for custom backendsManager<K, V>for per-key accumulators and expiration cleanup
Usage
[]
= "0.2.0-alpha.1"
use Arc;
use Duration;
use ;
let accumulator = new;
assert!;
assert!;
assert_eq!;
# Ok::
Key types
StateMachine<S, C>— apply typed guarded transitions and record an audit logAccumulator<V>— append values, flush manually, or flush when triggers fireAccumulatorConfig<V>— builder for TTL, keep-alive, max-size, triggers, and measurerManager<K, V>— route values to keyed accumulators and clean up expired entriesStore<V>— backend abstraction for buffered valuesMemoryStore<V>— in-memory store implementationCountMeasurer,ByteSizeMeasurer— built-in size measurement strategies