napi_unwrap

Function napi_unwrap 

Source
pub unsafe extern "C" fn napi_unwrap(
    env: napi_env,
    js_object: napi_value,
    result: *mut *mut c_void,
) -> napi_status
Available on crate feature napi only.
Expand description

Retrieves a native instance that was previously wrapped in an ArkTS object using napi_wrap.

§Arguments

  • env - Current running virtual machine context.

  • js_object - The ArkTS object.

  • result - Pointer to the wrapped native instance.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If the param env, js_object and(or) result is nullptr.

[napi_object_expected] If the param js_object is not an ArkTS Object.

[napi_pending_exception] If have uncaught exception, or exception occurred in execution.

Available since API-level: 10