Skip to main content

Module wasm

Module wasm 

Source
Expand description

WASM implementation

Re-exports§

pub use super::*;

Macros§

call_async_no_send
Awaits an async block or await expression whose future is not Send by dispatching it onto a local task and relaying the result back through a oneshot channel wrapped in Sendable. Accepts either an async block or an await expression and propagates errors with ?.

Structs§

Interval
Interval stream used by the interval() function to provide a a time interval stream. The stream is backed by tokio interval stream on native platforms and by by the JavaScript setInterval() and clearInterval() APIs in WASM32 environment.

Functions§

disable_persistent_timer_overrides
No-op on native targets; mirrors the WASM API that disables persistent timer overrides. Always returns Ok(()).
dispatch
Spawns a future onto the browser event loop without requiring it to be Send. Like spawn but accepts non-Send futures on the wasm32 target; panics on non-WASM targets.
interval
async interval() function backed by the JavaScript createInterval()
sleep
Waits until duration has elapsed.
spawn
Spawns a Send future onto the browser event loop on the wasm32 target; panics on non-WASM targets.
yield_now
Yields execution back to the Tokio runtime.