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

Provided Methods§

source

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

§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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ValidateNapiValue for &str

source§

impl ValidateNapiValue for &[f32]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &[f64]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &[i8]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &[i16]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &[i32]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &[i64]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &[u8]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &[u16]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &[u32]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &[u64]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [f32]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [f64]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [i8]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [i16]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [i32]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [i64]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [u8]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [u16]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [u32]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for &mut [u64]

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl ValidateNapiValue for bool

source§

impl ValidateNapiValue for f64

source§

impl ValidateNapiValue for i8

source§

impl ValidateNapiValue for i16

source§

impl ValidateNapiValue for i32

source§

impl ValidateNapiValue for i64

source§

impl ValidateNapiValue for u8

source§

impl ValidateNapiValue for u16

source§

impl ValidateNapiValue for u32

source§

impl ValidateNapiValue for String

source§

impl ValidateNapiValue for DateTime<Utc>

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl<K: From<String> + Eq + Hash, V: FromNapiValue> ValidateNapiValue for HashMap<K, V>

source§

impl<K: From<String> + Ord, V: FromNapiValue> ValidateNapiValue for BTreeMap<K, V>

source§

impl<K: From<String> + Hash + Eq, V: FromNapiValue> ValidateNapiValue for IndexMap<K, V>

source§

impl<T0: FromNapiValue, T1: FromNapiValue> ValidateNapiValue for (T0, T1)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue> ValidateNapiValue for (T0, T1, T2)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue, T7: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6, T7)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue, T7: FromNapiValue, T8: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue, T7: FromNapiValue, T8: FromNapiValue, T9: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue, T7: FromNapiValue, T8: FromNapiValue, T9: FromNapiValue, T10: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue, T7: FromNapiValue, T8: FromNapiValue, T9: FromNapiValue, T10: FromNapiValue, T11: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue, T7: FromNapiValue, T8: FromNapiValue, T9: FromNapiValue, T10: FromNapiValue, T11: FromNapiValue, T12: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue, T7: FromNapiValue, T8: FromNapiValue, T9: FromNapiValue, T10: FromNapiValue, T11: FromNapiValue, T12: FromNapiValue, T13: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue, T7: FromNapiValue, T8: FromNapiValue, T9: FromNapiValue, T10: FromNapiValue, T11: FromNapiValue, T12: FromNapiValue, T13: FromNapiValue, T14: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

source§

impl<T0: FromNapiValue, T1: FromNapiValue, T2: FromNapiValue, T3: FromNapiValue, T4: FromNapiValue, T5: FromNapiValue, T6: FromNapiValue, T7: FromNapiValue, T8: FromNapiValue, T9: FromNapiValue, T10: FromNapiValue, T11: FromNapiValue, T12: FromNapiValue, T13: FromNapiValue, T14: FromNapiValue, T15: FromNapiValue> ValidateNapiValue for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

impl<T> ValidateNapiValue for Vec<T>
where T: FromNapiValue,

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl<T: ValidateNapiValue> ValidateNapiValue for Option<T>

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl<T: ValidateNapiValue> ValidateNapiValue for Rc<T>

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl<T: ValidateNapiValue> ValidateNapiValue for Arc<T>

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

source§

impl<T: ValidateNapiValue> ValidateNapiValue for Mutex<T>

source§

unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>

Implementors§

source§

impl ValidateNapiValue for JsArrayBuffer

source§

impl ValidateNapiValue for JsBigInt

source§

impl ValidateNapiValue for JsBoolean

source§

impl ValidateNapiValue for JsBuffer

source§

impl ValidateNapiValue for JsDate

source§

impl ValidateNapiValue for JsExternal

source§

impl ValidateNapiValue for JsFunction

source§

impl ValidateNapiValue for JsNull

source§

impl ValidateNapiValue for JsNumber

source§

impl ValidateNapiValue for JsObject

source§

impl ValidateNapiValue for JsString

source§

impl ValidateNapiValue for JsSymbol

source§

impl ValidateNapiValue for JsUndefined

source§

impl ValidateNapiValue for UnknownReturnValue

source§

impl ValidateNapiValue for Latin1String

source§

impl ValidateNapiValue for Array

source§

impl ValidateNapiValue for BigInt64Array

source§

impl ValidateNapiValue for BigInt

source§

impl ValidateNapiValue for BigUint64Array

source§

impl ValidateNapiValue for Buffer

source§

impl ValidateNapiValue for BufferSlice<'_>

source§

impl ValidateNapiValue for Float32Array

source§

impl ValidateNapiValue for Float64Array

source§

impl ValidateNapiValue for Int8Array

source§

impl ValidateNapiValue for Int16Array

source§

impl ValidateNapiValue for Int32Array

source§

impl ValidateNapiValue for Null

source§

impl ValidateNapiValue for Symbol

source§

impl ValidateNapiValue for Uint8Array

source§

impl ValidateNapiValue for Uint8ClampedArray

source§

impl ValidateNapiValue for Uint8ClampedSlice<'_>

source§

impl ValidateNapiValue for Uint16Array

source§

impl ValidateNapiValue for Uint32Array

source§

impl ValidateNapiValue for JsUnknown

source§

impl ValidateNapiValue for Utf16String

source§

impl ValidateNapiValue for Undefined

source§

impl<'scope, Args: JsValuesTupleIntoVec, Return: FromNapiValue> ValidateNapiValue for Function<'scope, Args, Return>

source§

impl<A, B> ValidateNapiValue for Either<A, B>

source§

impl<A, B, C> ValidateNapiValue for Either3<A, B, C>

source§

impl<A, B, C, D> ValidateNapiValue for Either4<A, B, C, D>

source§

impl<A, B, C, D, E> ValidateNapiValue for Either5<A, B, C, D, E>

source§

impl<A, B, C, D, E, F> ValidateNapiValue for Either6<A, B, C, D, E, F>

source§

impl<A, B, C, D, E, F, G> ValidateNapiValue for Either7<A, B, C, D, E, F, G>

source§

impl<A, B, C, D, E, F, G, H> ValidateNapiValue for Either8<A, B, C, D, E, F, G, H>

source§

impl<A, B, C, D, E, F, G, H, I> ValidateNapiValue for Either9<A, B, C, D, E, F, G, H, I>

source§

impl<A, B, C, D, E, F, G, H, I, J> ValidateNapiValue for Either10<A, B, C, D, E, F, G, H, I, J>

source§

impl<A, B, C, D, E, F, G, H, I, J, K> ValidateNapiValue for Either11<A, B, C, D, E, F, G, H, I, J, K>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> ValidateNapiValue for Either12<A, B, C, D, E, F, G, H, I, J, K, L>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M> ValidateNapiValue for Either13<A, B, C, D, E, F, G, H, I, J, K, L, M>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> ValidateNapiValue for Either14<A, B, C, D, E, F, G, H, I, J, K, L, M, N>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> ValidateNapiValue for Either15<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> ValidateNapiValue for Either16<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q> ValidateNapiValue for Either17<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R> ValidateNapiValue for Either18<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S> ValidateNapiValue for Either19<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T> ValidateNapiValue for Either20<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U> ValidateNapiValue for Either21<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V> ValidateNapiValue for Either22<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W> ValidateNapiValue for Either23<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X> ValidateNapiValue for Either24<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y> ValidateNapiValue for Either25<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> ValidateNapiValue for Either26<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z>

source§

impl<Args: JsValuesTupleIntoVec, Return: FromNapiValue> ValidateNapiValue for FunctionRef<Args, Return>

source§

impl<T: 'static> ValidateNapiValue for ClassInstance<T>

source§

impl<T: 'static> ValidateNapiValue for External<T>

source§

impl<T: FromNapiValue> ValidateNapiValue for Promise<T>