Module napi::bindgen_prelude
source · Re-exports
pub use crate::sys;
pub use crate::error::*;
Modules
Structs
- https://nodejs.org/api/n-api.html#napi_create_bigint_words The resulting BigInt is calculated as: (–1)^sign_bit (words[0] × (2^64)^0 + words[1] × (2^64)^1 + …)
- Zero copy u8 vector shared between rust and napi. Auto reference the raw JavaScript value, and release it when dropped. So it is safe to use it in
async fn
, the&[u8]
under the hood will not be dropped until thedrop
called. Clone will create a newReference
to the same underlyingJavaScript Buffer
. Env
is used to represent a context that the underlying N-API implementation can use to persist VM-specific state.- Experimental feature
- Experimental feature
- i64 is converted to
Number
Enums
Traits
- Implement a Iterator for the JavaScript Class. This feature is an experimental feature and is not yet stable.
Functions
- Runs a future to completion This is blocking, meaning that it pauses other execution until the future is complete, only use it when it is absolutely necessary, in other places use async functions instead.
- Get
C Callback
from defined Rustfn
- Get
JsFunction
from defined Rustfn
- Spawns a future onto the Tokio runtime.
- If the feature
tokio_rt
has been enabled this will enter the runtime context and then call the provided closure. Otherwise it will just call the provided closure.
Type Definitions
Attribute Macros
- Marks a function or static variable as a library/executable constructor. This uses OS-specific linker sections to call a specific function at load time.