Struct JsFuture
pub struct JsFuture<T = JsValue> { /* private fields */ }
A Rust Future backed by a JavaScript Promise.
This type is constructed with a JavaScript Promise object and translates
it to a Rust Future. This type implements the Future trait from the
futures crate and will either succeed or fail depending on what happens
with the JavaScript Promise.
Currently this type is constructed with JsFuture::from.
Trait Implementations
impl UnwindSafe for JsFuture
impl<T> Debug for JsFuture<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T> ErasableGeneric for JsFuture<T>
type Repr = JsFuture;
impl<T> Future for JsFuture<T>
type Output = Result<T, JsValue>;fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
impl<T, Target> Upcast<JsFuture<Target>> for JsFuture<T>
where
T: Upcast<Target>,
impl<T: FromWasmAbi + 'static> From<Promise<T>> for JsFuture<T>
fn from(js: Promise<T>) -> JsFuture<T>