wasm_bindgen_futures/lib.rs
1//! Bridging the gap between Rust Futures and JavaScript Promises.
2//!
3//! This crate is now a thin shim re-exporting from [`js_sys::futures`].
4//! The implementation has been moved into `js-sys` so that
5//! [`js_sys::Promise`] can implement [`core::future::IntoFuture`] directly,
6//! enabling `promise.await` without any wrapper type.
7//!
8//! All public items (`JsFuture`, `spawn_local`, `future_to_promise`,
9//! `future_to_promise_typed`) are re-exported unchanged for backwards
10//! compatibility.
11
12#![cfg_attr(not(feature = "std"), no_std)]
13
14pub use js_sys::futures::{future_to_promise, future_to_promise_typed, spawn_local, JsFuture};
15
16#[cfg(feature = "futures-core-03-stream")]
17pub use js_sys::futures::stream;
18
19pub use js_sys;
20pub use wasm_bindgen;