Expand description
Platform-aware primitives for native and wasm32 targets.
One backend tree per configuration — native, wasm, or flash — is
selected by the gated glob re-exports below; the backends mirror one
public module tree 1:1 (sync, thread, time, tokio, …) and
100% cross-platform code lives in common. All crate cfg lives in this
file. See the crate CONTEXT.md for per-target backends.
Modules§
- env
- flash
- logging
- maybe_
send - sync
- Platform-optimal synchronization primitives (native), backed by
parking_lot(no poisoning, smaller footprint). - thread
- time
- tokio
- Mirror of the tokio surface the workspace is allowed to touch.
Enumerated on purpose: a glob re-export is how unvetted primitives
leak in unnoticed (see design doc §2).
time/net/fs/io/processand the rootspawn/spawn_blockingare intentionally ABSENT.task_local!is native-only (no task-scope surface in the wasm subset).signalis opt-in for desktop binaries that own process shutdown. - traits
- Shared conversion traits used across the workspace.
Structs§
- Cancel
Group - OR-combinator for cancellation tokens.
- Cancel
Scope - A cancellation scope owned by a subsystem.
- Cancel
Token - A handle into a cancel subtree.
- Cancel
Waker Guard - Drop guard returned by
CancelToken::on_cancel. Unregisters the waker on drop; holding it keeps the cancel-wake live. - Cancelled
- Future returned by
CancelToken::cancelled. Resolves once the token’s subtree is cancelled.Unpin; cancel-safe (drop unregisters its slot).