pub trait ValidateNapiValue: FromNapiValue + TypeName {
    unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value> { ... }
}

Provided Methods§

Safety

this function called to validate whether napi value passed to rust is valid type The reason why this function return napi_value is that if a Promise<T> passed in we need to return Promise.reject(T), not the T. So we need to create Promise.reject(T) in this function.

Implementations on Foreign Types§

Implementors§