pub enum Job {
Reaction {
handler: Option<Value>,
argument: Value,
rejected: bool,
promise: Gc<JsObject>,
},
Thenable {
then: Value,
value: Value,
promise: Gc<JsObject>,
},
Import {
specifier: String,
referrer: String,
promise: Gc<JsObject>,
},
GeneratorResume {
generator: Gc<JsObject>,
promise: Gc<JsObject>,
kind: ResumeKind,
value: Value,
},
Resume {
coroutine: Gc<JsObject>,
promise: Gc<JsObject>,
kind: ResumeKind,
value: Value,
},
}Expand description
One microtask.
The queue holds data rather than closures because its contents are GC values: a closure would be invisible to the collector, and a pending reaction is exactly the kind of thing that must keep its handlers and its promise alive.
Variants§
Reaction
A then reaction about to run.
Fields
Thenable
Adopt a thenable: call its then with the adopting promise’s resolve/reject.
Fields
Import
A pending import(specifier).
Fields
GeneratorResume
An async generator resuming after the value it awaited settled.
Fields
§
kind: ResumeKindWhether this delivers the value or raises the reason.
Resume
An async function resuming after the value it awaited settled.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Job
impl !Send for Job
impl !Sync for Job
impl !UnwindSafe for Job
impl Forget for Job
impl Freeze for Job
impl Move for Job
impl Unpin for Job
impl UnsafeUnpin for Job
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