Struct Suspending
#[repr(transparent)]
pub struct Suspending { /* private fields */ }
A WebAssembly.Suspending object wraps a JavaScript async function
so it can be used as a WebAssembly import under
JSPI (JS Promise Integration).
When WASM calls a Suspending-wrapped import that returns a
Promise, the WASM fiber suspends until the promise settles; the
resolved value is then returned to WASM as if the call had returned
synchronously. The browser's event loop is not blocked.
Implementations
impl Suspending
fn new(func: &Function) -> SuspendingWraps
func(an async function) in aWebAssembly.Suspendingobject.Pass the returned object as a WASM import. Every call to that import from WASM will suspend the current fiber and resume it with the resolved value once
func's returnedPromisesettles.
Trait Implementations
impl AsRef<JsValue> for Suspending
fn as_ref(&self) -> &JsValue
impl AsRef<Object> for Suspending
fn as_ref(&self) -> &Object
impl AsRef<Suspending> for Suspending
fn as_ref(&self) -> &Suspending
impl Clone for Suspending
fn clone(&self) -> Self
impl Debug for Suspending
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Deref for Suspending
type Target = Object;fn deref(&self) -> &Object
impl Eq for Suspending
impl ErasableGeneric for Suspending
type Repr = JsValue;
impl From<JsValue> for Suspending
fn from(obj: JsValue) -> Self
impl FromWasmAbi for Suspending
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for Suspending
where
Suspending: JsGeneric,
type JsCanon = Suspending;fn to_js(self) -> Suspending
impl IntoWasmAbi for Suspending
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for Suspending
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for Suspending
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = Suspending;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl OptionFromWasmAbi for Suspending
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for Suspending
fn none() -> Self::Abi
impl PartialEq for Suspending
fn eq(&self, other: &Self) -> bool
impl Promising for Suspending
type Resolution = Suspending;
impl RefFromWasmAbi for Suspending
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<Suspending>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl StructuralPartialEq for Suspending
impl UpcastFrom<Suspending> for Suspending
impl WasmDescribe for Suspending
fn describe()