pub unsafe extern "C" fn napi_create_external(
env: napi_env,
data: *mut c_void,
finalize_cb: napi_finalize,
finalize_hint: *mut c_void,
result: *mut napi_value,
) -> napi_statusAvailable on crate feature
napi only.Expand description
Allocates a JS value with external data.
§Arguments
-
env- Current running virtual machine context. -
data- Allocates a JS value that references external data. -
finalize_cb- Optional callback to call when the external value is being collected. -
finalize_hint- Optional hint that can be passed to the finalize callback function during the garbage collection process. -
result- A napi_value representing an external value.
§Returns
- Returns the function execution status.
[
napi_ok] If the function executed successfully.
[napi_invalid_arg] If the param env or result is nullptr.
[napi_pending_exception] There is an uncaught exception occurred before(in) execution.
Available since API-level: 10