Expand description
proxima_core::time (re-exported as proxima::time) — runtime-agnostic
timer primitives shaped like tokio::time. The active backend (host
thread, embassy, prime’s per-core wheel, deterministic mock, or a
user-supplied hardware driver) is selected by the active
proxima_build::Profile via the timer axis; build.rs bakes a
&'static dyn Driver symbol into the build, so Sleep::poll’s only
runtime cost is one virtual dispatch.
Folded in from the former proxima-time satellite crate (single
consumer: the workspace’s timer surface) — proxima_core::time::{sleep, timeout, interval, Driver, Instant} is unchanged for callers that used
to spell it proxima_time::{..}.
Modules§
- drivers
- First-party
Driverimplementations. Each is behind its owntime-driver-*feature; the active driver is bound at link time viaBOUND_DRIVER(emitted byproxima-core/build.rs).
Structs§
- Elapsed
- Returned by
timeoutwhen the supplied duration passes before the wrapped future completes. Matchestokio::time::error::Elapsed. - Instant
- Monotonic point in time. Internally a
Durationsince the active driver’s epoch — comparisons and arithmetic are well-defined as long as both operands came from the same driver instance, which the link-time-boundBOUND_DRIVERguarantees. - Interval
- Periodic timer.
.tick().awaitreturns theInstantat which the tick fired (matching tokio); also implementsStream<Item = ()>. - Sleep
- Future returned by
sleep/sleep_until. Resolves when the active driver’snow()reachesdeadline. - Tick
- Future returned by
Interval::tick.
Enums§
- Missed
Tick Behavior - What happens when an
Intervalconsumer skips past a tick deadline (consumer time exceeded the period). Shape matchestokio::time::MissedTickBehavior.
Statics§
Traits§
- Driver
- The timer driver interface every backend implements. Selected at build time
by the
timeraxis of the active profile; bound at link time via the staticBOUND_DRIVERsymbolproxima-time’s build emits.
Functions§
- interval
- Stream + tick-future hybrid that yields every
period, with the first item delivered immediately. Matchestokio::time::intervalergonomically (.tick().await -> Instant) AND exposesStream<Item = ()>for callers that prefer that shape. - interval_
at - Like
intervalbut the first tick fires atstartrather than immediately. - now
- Capture the current monotonic time from the link-time-bound driver. (The
driver-free
Instantin the leaf cannot reachBOUND_DRIVER, sonow()lives here.) - sleep
- Resolves after
durationhas elapsed on the bound driver’s clock. Shape-compatible withtokio::time::sleep. - sleep_
until - Resolves at the given deadline. Shape-compatible with
tokio::time::sleep_until. If the deadline is in the past, the returned future resolves on first poll. - timeout
- Race
futureagainst a timer ofduration. ReturnsErr(Elapsed)if the timer fires first. - timeout_
at - Race
futureagainst a deadline. Shape-compatible withtokio::time::timeout_at.