pub struct NapiCallbackScope(/* private fields */);
Expand description
There are cases (for example, resolving promises) where it is necessary to have the equivalent of the scope associated with a callback in place when making certain Node-API calls. If there is no other script on the stack the napi_open_callback_scope and napi_close_callback_scope functions can be used to open/close the required scope.
Implementations§
Source§impl NapiCallbackScope
impl NapiCallbackScope
pub fn env(&self) -> NapiEnv
pub fn raw(&self) -> napi_callback_scope
pub fn close(&mut self) -> NapiResult<()>
Trait Implementations§
Source§impl Clone for NapiCallbackScope
impl Clone for NapiCallbackScope
Source§fn clone(&self) -> NapiCallbackScope
fn clone(&self) -> NapiCallbackScope
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NapiCallbackScope
impl Debug for NapiCallbackScope
Auto Trait Implementations§
impl Freeze for NapiCallbackScope
impl RefUnwindSafe for NapiCallbackScope
impl !Send for NapiCallbackScope
impl !Sync for NapiCallbackScope
impl Unpin for NapiCallbackScope
impl UnwindSafe for NapiCallbackScope
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