Skip to main content

Module bindgen_prelude

Module bindgen_prelude 

Source

Re-exports§

pub use crate::error;
pub use crate::JsError;
pub use crate::JsValue;
pub use crate::Property;
pub use crate::PropertyAttributes;
pub use crate::Result;
pub use crate::Status;
pub use crate::Task;
pub use crate::ValueType;
pub use crate::Env;
pub use crate::JsDate as Date;
pub use crate::JsFunction;Deprecated
pub use crate::sys;
pub use ::tracing;

Modules§

async_iterator
iterator

Structs§

AbortSignal
https://developer.mozilla.org/zh-CN/docs/Web/API/AbortController
Array
ArrayBuffer
Represents a JavaScript ArrayBuffer
AsyncBlock
AsyncBlockBuilder
AsyncTask
BigInt
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 + …)
BigInt64Array
BigInt64ArraySlice
BigUint64Array
BigUint64ArraySlice
Buffer
Zero copy u8 vector shared between rust and napi. It’s designed to be used in async context, so it contains overhead to ensure the underlying data is not dropped. For non-async context, use BufferSlice instead.
BufferSlice
Zero copy buffer slice shared between Rust and Node.js.
CallbackContext
ClassInstance
Error
Represent JsError. Return this Error in js_function, napi-rs will throw it as JsError for you. If you want throw it as TypeError or RangeError, you can use JsTypeError/JsRangeError::from(Error).throw_into(env)
EscapableHandleScope
ExtendedErrorInfo
External
ExternalRef
ExternalRef is a reference to an External object
FinalizeContext
Float32Array
Float32ArraySlice
Float64Array
Float64ArraySlice
FnArgs
Function
A JavaScript function. It can only live in the scope of a function call. If you want to use it outside the scope of a function call, you can turn it into a reference. By calling the create_ref method.
FunctionCallContext
FunctionRef
A reference to a JavaScript function. It can be used to outlive the scope of the function.
HandleScope
Int8Array
Int8ArraySlice
Int16Array
Int16ArraySlice
Int32Array
Int32ArraySlice
IteratorValue
JsError
JsRangeError
JsSyntaxError
JsTypeError
Latin1String
Null
Object
ObjectRef
A reference to a JavaScript object.
Promise
The JavaScript Promise object representation
PromiseRaw
RawCString
A wrapper around the raw c_char pointer to a C string.
ReadableStream
Reader
Reference
Create a napi_ref from Class instance.
SharedReference
Experimental feature
Symbol
This
ThreadsafeFunctionBuilder
TypedArray
Represents a JavaScript ArrayBuffer
Uint8Array
Uint8ArraySlice
Uint8ClampedArray
Uint8ClampedSlice
Zero copy Uint8ClampedArray slice shared between Rust and Node.js. It can only be used in non-async context and the lifetime is bound to the fn closure. If you want to use Node.js Uint8ClampedArray in async context or want to extend the lifetime, use Uint8ClampedArray instead.
Uint16Array
Uint16ArraySlice
Uint32Array
Uint32ArraySlice
Unknown
Represents a raw JavaScript value
Utf16String
WeakReference
WriteableStream
i64n
i64 is converted to Number

Enums§

Either
Either3
Either4
Either5
Either6
Either7
Either8
Either9
Either10
Either11
Either12
Either13
Either14
Either15
Either16
Either17
Either18
Either19
Either20
Either21
Either22
Either23
Either24
Either25
Either26
KeyCollectionMode
KeyConversion
KeyFilter
TypedArrayType

Constants§

NAPI_AUTO_LENGTH

Statics§

NODE_VERSION_MAJOR
NODE_VERSION_MINOR
NODE_VERSION_PATCH

Traits§

AsyncGenerator
Implement a Iterator for the JavaScript Class. This feature is an experimental feature and is not yet stable.
FromNapiMutRef
FromNapiRef
FromNapiValue
Generator
Implement a Iterator for the JavaScript Class. This feature is an experimental feature and is not yet stable.
JavaScriptClassExt
JsObjectValue
JsValuesTuple
JsValuesTupleIntoVec
ObjectFinalize
ToNapiValue
TupleFromSliceValues
TypeName
ValidateNapiValue

Functions§

block_on
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.
create_custom_tokio_runtime
execute_tokio_future
within_runtime_if_available

Type Aliases§

ExportRegisterCallback
ExportRegisterHookCallback
ModuleExportsCallback
Result
Undefined

Attribute Macros§

ctor