neon/sys/
raw.rs

1use std::ptr;
2
3use super::bindings as napi;
4
5pub type Local = napi::Value;
6
7pub type FunctionCallbackInfo = napi::CallbackInfo;
8
9pub type Env = napi::Env;
10
11#[repr(C)]
12#[derive(Clone, Copy)]
13pub struct HandleScope {
14    pub word: napi::HandleScope,
15}
16
17impl HandleScope {
18    pub fn new() -> Self {
19        Self {
20            word: ptr::null_mut(),
21        }
22    }
23}
24
25impl Default for HandleScope {
26    fn default() -> Self {
27        Self::new()
28    }
29}
30
31#[repr(C)]
32#[derive(Clone, Copy)]
33pub struct EscapableHandleScope {
34    pub word: napi::EscapableHandleScope,
35}
36
37impl EscapableHandleScope {
38    pub fn new() -> Self {
39        Self {
40            word: ptr::null_mut(),
41        }
42    }
43}
44
45impl Default for EscapableHandleScope {
46    fn default() -> Self {
47        Self::new()
48    }
49}