#[repr(transparent)]pub struct JsPromise(_);
Creates a new
Promise immediately resolved with the given value. If the value is a
Promise or a then-able, it will be flattened.
JsPromise::resolve is useful to ensure a value that might not be a
might not be a native promise is converted to a
Promise before use.
Creates a nwe
Promise immediately rejected with the given error.
Available on crate features
Future that can be awaited to receive the result of a
A callback must be provided that maps a
Result representing the resolution or rejection of
Promise and returns a value as the
Promise are eagerly evaluated and so are
undefinedand attempts to downcast the value if it existed. Read more
obj.get_value(&mut cx)?.downcast_or_throw(&mut cx). Read more
Returns the argument unchanged.