Skip to main content

napi_create_strong_sendable_reference

Function napi_create_strong_sendable_reference 

Source
pub unsafe extern "C" fn napi_create_strong_sendable_reference(
    env: napi_env,
    value: napi_value,
    result: *mut napi_sendable_ref,
) -> napi_status
Available on crate features napi and api-22 only.
Expand description

Creates a strong sendable reference for an ArkTS object to extend its lifespan. The caller needs to manage the sendable reference lifespan.

§Arguments

  • env - Current running virtual machine context.

  • value - The sendable ArkTS object that is being referenced.

  • result - The napi_sendable_ref pointing to the new strong sendable reference.

§Returns

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

[napi_invalid_arg] If env, value or result is nullptr.

Available since API-level: 22