Struct nodex_api::scope::NapiHandleScope
source · [−]pub struct NapiHandleScope(_, _);
Expand description
Node-API provides the ability to establish a new ‘scope’ to which newly created handles will be associated. Once those handles are no longer required, the scope can be ‘closed’ and any handles associated with the scope are invalidated. The methods available to open/close scopes are napi_open_handle_scope and napi_close_handle_scope.
Node-API only supports a single nested hierarchy of scopes. There is only one active scope at any time, and all new handles will be associated with that scope while it is active. Scopes must be closed in the reverse order from which they are opened. In addition, all scopes created within a native method must be closed before returning from that method.
Implementations
This API opens a new scope.
This API closes the scope passed in. Scopes must be closed in the reverse order from which they were created. This API can be called even if there is a pending JavaScript exception.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for NapiHandleScope
impl !Send for NapiHandleScope
impl !Sync for NapiHandleScope
impl Unpin for NapiHandleScope
impl UnwindSafe for NapiHandleScope
Blanket Implementations
Mutably borrows from an owned value. Read more