Struct PromiseState

#[must_use]
#[repr(transparent)]
pub struct PromiseState<T = JsValue> { /* private fields */ }

The PromiseState object represents the the status of the promise, as used in allSettled.

MDN documentation

Implementations

impl<T> PromiseState<T>

fn is_fulfilled(&self) -> bool
fn is_rejected(&self) -> bool

impl<T> PromiseState<T>

fn get_status(&self) -> String

A string, either "fulfilled" or "rejected", indicating the eventual state of the promise.

impl<T> PromiseState<T>

fn get_value(&self) -> Option<T>
where
    Option<T>: ErasableGenericOwn<Option<JsValue>>,

Only present if status is "fulfilled". The value that the promise was fulfilled with.

impl<T> PromiseState<T>

fn get_reason(&self) -> Option<JsValue>

Only present if status is "rejected". The reason that the promise was rejected with.

Trait Implementations

impl From<JsValue> for PromiseState

fn from(obj: JsValue) -> Self

impl<T> AsRef<JsValue> for PromiseState<T>

fn as_ref(&self) -> &JsValue

impl<T> AsRef<Object> for PromiseState<T>

fn as_ref(&self) -> &Object

impl<T> AsRef<PromiseState<T>> for PromiseState<T>

fn as_ref(&self) -> &PromiseState<T>

impl<T> Deref for PromiseState<T>

type Target = Object;
fn deref(&self) -> &Object

impl<T> ErasableGeneric for PromiseState<T>

type Repr = JsValue;

impl<T> FromWasmAbi for PromiseState<T>

type Abi = <JsValue as FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self

impl<T> IntoJsGeneric for PromiseState<T> where PromiseState<T>: JsGeneric,

type JsCanon = PromiseState<T>;
fn to_js(self) -> PromiseState<T>

impl<T> IntoWasmAbi for PromiseState<T>

type Abi = <JsValue as IntoWasmAbi>::Abi;
fn into_abi(self) -> Self::Abi

impl<T> JsCast for PromiseState<T>

fn instanceof(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self

impl<T> LongRefFromWasmAbi for PromiseState<T>

type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = PromiseState<T>;
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

impl<T> OptionFromWasmAbi for PromiseState<T>

fn is_none(abi: &Self::Abi) -> bool

impl<T> OptionIntoWasmAbi for PromiseState<T>

fn none() -> Self::Abi

impl<T> Promising for PromiseState<T>

type Resolution = PromiseState<T>;

impl<T> RefFromWasmAbi for PromiseState<T>

type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<PromiseState<T>>;
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

impl<T> WasmDescribe for PromiseState<T>

fn describe()

impl<T, __UpcastTarget0> UpcastFrom<PromiseState<T>> for PromiseState<__UpcastTarget0> where __UpcastTarget0: UpcastFrom<T>,

impl<T: Clone> Clone for PromiseState<T>

fn clone(&self) -> Self

impl<T: Debug> Debug for PromiseState<T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<T> Freeze for PromiseState<T> where PhantomData<(T,)>: Freeze,

impl<T> RefUnwindSafe for PromiseState<T> where PhantomData<(T,)>: RefUnwindSafe,

impl<T> Send for PromiseState<T> where PhantomData<(T,)>: Send,

impl<T> Sync for PromiseState<T> where PhantomData<(T,)>: Sync,

impl<T> Unpin for PromiseState<T> where PhantomData<(T,)>: Unpin,

impl<T> UnsafeUnpin for PromiseState<T> where PhantomData<(T,)>: UnsafeUnpin,

impl<T> UnwindSafe for PromiseState<T> where PhantomData<(T,)>: UnwindSafe,

Blanket Implementations

impl<P, T> Receiver for PromiseState<T> where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for PromiseState<T> where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for PromiseState<T> where T: 'static + ?Sized,

impl<T> Borrow<T> for PromiseState<T> where T: ?Sized,

impl<T> BorrowMut<T> for PromiseState<T> where T: ?Sized,

impl<T> CloneToUninit for PromiseState<T> where T: Clone,

impl<T> From<T> for PromiseState<T>

impl<T> JsGeneric for PromiseState<T> where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for PromiseState<T> where T: IntoWasmAbi,

impl<T> ToOwned for PromiseState<T> where T: Clone,

impl<T> TryFromJsValue for PromiseState<T> where T: JsCast,

impl<T> VectorFromWasmAbi for PromiseState<T> where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for PromiseState<T> where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for PromiseState<T> where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for PromiseState<T> where U: From<T>,

impl<T, U> TryFrom<U> for PromiseState<T> where U: Into<T>,

impl<T, U> TryInto<U> for PromiseState<T> where U: TryFrom<T>,