Skip to main content

Crate wasm_bindgen_futures

Crate wasm_bindgen_futures 

Source
Expand description

Bridging the gap between Rust Futures and JavaScript Promises.

This crate is now a thin shim re-exporting from js_sys::futures. The implementation has been moved into js-sys so that js_sys::Promise can implement core::future::IntoFuture directly, enabling promise.await without any wrapper type.

All public items (JsFuture, spawn_local, future_to_promise, future_to_promise_typed) are re-exported unchanged for backwards compatibility.

Re-exports§

pub use js_sys;
pub use wasm_bindgen;

Modules§

stream
Converting JavaScript AsyncIterators to Rust Streams.

Structs§

JsFuture
A Rust Future backed by a JavaScript Promise.

Functions§

future_to_promise
Converts a Rust Future into a JavaScript Promise.
future_to_promise_typed
Converts a Rust Future into a corresponding typed JavaScript Promise<T>.
spawn_local
Runs a Rust Future on the current thread.