#[repr(transparent)]pub struct JsPromise(_);
This is supported on crate feature
promise-api
only.Expand description
The JavaScript Promise
value.
JsPromise
may be constructed with Context::promise
.
Trait Implementations
sourceimpl Object for JsPromise
impl Object for JsPromise
sourcefn get_opt<'a, V: Value, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Option<Handle<'a, V>>>
fn get_opt<'a, V: Value, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Option<Handle<'a, V>>>
Gets a property from a JavaScript object that may be undefined
and
attempts to downcast the value if it existed. Read more
sourcefn get_value<'a, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Handle<'a, JsValue>>
fn get_value<'a, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Handle<'a, JsValue>>
sourcefn get<'a, V: Value, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Handle<'a, V>>
fn get<'a, V: Value, C: Context<'a>, K: PropertyKey>(
&self,
cx: &mut C,
key: K
) -> NeonResult<Handle<'a, V>>
Gets a property from a JavaScript object and attempts to downcast as a specific type.
Equivalent to calling obj.get(&mut cx)?.downcast_or_throw(&mut cx)
. Read more
sourcefn get_own_property_names<'a, C: Context<'a>>(
&self,
cx: &mut C
) -> JsResult<'a, JsArray>
fn get_own_property_names<'a, C: Context<'a>>(
&self,
cx: &mut C
) -> JsResult<'a, JsArray>
This is supported on crate feature
napi-6
only.fn set<'a, C: Context<'a>, K: PropertyKey, W: Value>(
&self,
cx: &mut C,
key: K,
val: Handle<'_, W>
) -> NeonResult<bool>
fn root<'a, C: Context<'a>>(&self, cx: &mut C) -> Root<Self>
Auto Trait Implementations
impl RefUnwindSafe for JsPromise
impl !Send for JsPromise
impl !Sync for JsPromise
impl Unpin for JsPromise
impl UnwindSafe for JsPromise
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more