Enum napi::bindgen_prelude::Either
source · pub enum Either<A, B> {
A(A),
B(B),
}
Variants
A(A)
B(B)
Implementations
Trait Implementations
sourceimpl<T> From<Either<T, JsUndefined>> for Option<T>
impl<T> From<Either<T, JsUndefined>> for Option<T>
sourcefn from(value: Either<T, JsUndefined>) -> Option<T>
fn from(value: Either<T, JsUndefined>) -> Option<T>
Converts to this type from the input type.
sourceimpl<A: TypeName + FromNapiValue + ValidateNapiValue, B: TypeName + FromNapiValue + ValidateNapiValue> FromNapiValue for Either<A, B>
impl<A: TypeName + FromNapiValue + ValidateNapiValue, B: TypeName + FromNapiValue + ValidateNapiValue> FromNapiValue for Either<A, B>
sourceunsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self>
sourceimpl<A: ToNapiValue, B: ToNapiValue> ToNapiValue for Either<A, B>
impl<A: ToNapiValue, B: ToNapiValue> ToNapiValue for Either<A, B>
sourceunsafe fn to_napi_value(env: napi_env, value: Self) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, value: Self) -> Result<napi_value>
Safety Read more
sourceimpl<A: ValidateNapiValue, B: ValidateNapiValue> ValidateNapiValue for Either<A, B>
impl<A: ValidateNapiValue, B: ValidateNapiValue> ValidateNapiValue for Either<A, B>
sourceunsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
impl<A: Copy, B: Copy> Copy for Either<A, B>
impl<A: Send, B: Send> Send for Either<A, B>
impl<A: Sync, B: Sync> Sync for Either<A, B>
Auto Trait Implementations
impl<A, B> RefUnwindSafe for Either<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Unpin for Either<A, B>where
A: Unpin,
B: Unpin,
impl<A, B> UnwindSafe for Either<A, B>where
A: UnwindSafe,
B: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more