Expand description
RuntimeFactory sibling trait + the *Like primitive shapes.
Design constraint: Runtime stays dyn-compatible because the
runtime threads &dyn Runtime through per-core dispatch, and GAT
associated-type factories on it would break that workspace-wide.
Resolution: a SIBLING trait RuntimeFactory: Runtime carries the
typed primitive factories. TokioPerCoreRuntime and PrimeRuntime
impl BOTH; consumers that need typed Mutex / Notify / JoinSet /
Sleep bound on R: RuntimeFactory (which implies Runtime).
Enums§
- Join
Error - Opaque join-failure reason. Wraps the runtime’s native error type
(
tokio::task::JoinErrorfor the tokio impl).
Traits§
- Join
SetLike - A handle that yields a task’s result on
awaitand supports abort. Matchestokio::task::JoinSet’s shape. - Local
Mutex Like - Non-Send mutex shape for runtimes that pin tasks to a
single core. The guard is
!Sendso callers can’t accidentally move it across cores; in exchange the underlying primitive can skip the atomic/notification dance a Send Mutex needs. - Local
Notify Like - Non-Send notify shape. Same single-core opt-in contract as
LocalMutexLike. - Local
Runtime Factory - Sibling extension of
Runtimefor runtimes that pin tasks to a single core (prime’s per-core executor, embedded runtimes with no multi-thread executor at all). Provides non-Send primitive factories that skip the atomic synchronization a Send-shaped primitive needs. - Mutex
Like - Async mutex shape. The guard type is borrowed so callers can hold
the lock across an
awaitwithout paying a clone. Implementations supply the actual lock primitive —tokio::sync::Mutex<T>for the tokio impl, a per-core single-writer lock for prime. - Notify
Like - Notification primitive.
notify_onewakes one waiter; subsequentnotified().awaitresumes when the next signal arrives. - Runtime
Factory - Sibling extension of
Runtime: typed factory methods for the per-session sync / task / time primitives. Implemented by every concrete runtime that ships in the workspace (TokioPerCoreRuntime,PrimeRuntime). Consumers bound onR: RuntimeFactorywhen they need typed primitives; consumers that only need to spawn stay onR: Runtimeand the trait stays dyn-compatible.