pub struct PromiseState {
pub status: PromiseStatus,
pub reactions: Vec<PromiseReaction>,
pub handled: bool,
}Expand description
A Promise’s state, shared between the promise object and its resolve/reject
functions.
Behind an Rc for the same reason a proxy’s slots are: the resolve and reject
functions handed to an executor have to settle this promise later, from a call site
that only has the function.
Fields§
§status: PromiseStatusPending, or the value it settled with.
reactions: Vec<PromiseReaction>The then reactions waiting on it, in registration order.
handled: boolWhether a rejection has been seen by a handler.
A rejection that never is becomes an unhandled-rejection report, which the reference makes fatal at the end of the job queue.
Trait Implementations§
Source§impl Default for PromiseState
impl Default for PromiseState
Auto Trait Implementations§
impl !RefUnwindSafe for PromiseState
impl !Send for PromiseState
impl !Sync for PromiseState
impl !UnwindSafe for PromiseState
impl Forget for PromiseState
impl Freeze for PromiseState
impl Move for PromiseState
impl Unpin for PromiseState
impl UnsafeUnpin for PromiseStatewhere
*const GcBox<JsString> is !null: UnsafeUnpin,
*const GcBox<JsObject> is !null: UnsafeUnpin,
*const GcBox<JsSymbol> is !null: UnsafeUnpin,
*const GcBox<BigInt> is !null: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<PromiseReaction>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more