Skip to main content

Module core

Module core 

Source
Expand description

Runtime abstraction: clock, sleeping, and RNG behind one object-safe trait.

Structs§

ManualClock
A virtual clock for deterministic tests. now() advances only via ManualClock::advance; sleeps registered on it resolve when crossed.
TestCore
Deterministic Core for tests: virtual clock + seeded RNG, no real sleeps.
TokioCore
Default production Core: tokio timers + a fast non-crypto RNG for jitter.

Traits§

Core
The policy engine’s access to time, sleeping, and randomness.

Type Aliases§

BoxFuture
A boxed future. Core::sleep returns this so the trait stays object-safe (Arc<dyn Core> works); the box is on the cold backoff path only.
DefaultCore
The Core used by ExecutionPolicy::builder().build().