napi_coerce_to_string

Function napi_coerce_to_string 

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

Coerce the given ArkTS value to an ArkTS string value.

§Arguments

  • env - Current running virtual machine context.

  • value - The ArkTS value to coerce.

  • result - The coerced ArkTS string value.

§Returns

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

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

Available since API-level: 10