Enum napi::bindgen_prelude::Either
source · [−]pub enum Either<A: TypeName + FromNapiValue + ToNapiValue, B: TypeName + FromNapiValue + ToNapiValue> {
A(A),
B(B),
}
Variants
A(A)
B(B)
Implementations
sourceimpl<A: TypeName + FromNapiValue + ToNapiValue + NapiRaw, B: TypeName + FromNapiValue + ToNapiValue + NapiRaw> Either<A, B>
impl<A: TypeName + FromNapiValue + ToNapiValue + NapiRaw, B: TypeName + FromNapiValue + ToNapiValue + NapiRaw> Either<A, B>
sourcepub unsafe fn raw(&self) -> napi_value
pub unsafe fn raw(&self) -> napi_value
Safety
Backward compatible with Either
in v1
Trait Implementations
sourceimpl<A: Clone + TypeName + FromNapiValue + ToNapiValue, B: Clone + TypeName + FromNapiValue + ToNapiValue> Clone for Either<A, B>
impl<A: Clone + TypeName + FromNapiValue + ToNapiValue, B: Clone + TypeName + FromNapiValue + ToNapiValue> Clone for Either<A, B>
sourceimpl<A: Debug + TypeName + FromNapiValue + ToNapiValue, B: Debug + TypeName + FromNapiValue + ToNapiValue> Debug for Either<A, B>
impl<A: Debug + TypeName + FromNapiValue + ToNapiValue, B: Debug + TypeName + FromNapiValue + ToNapiValue> Debug for Either<A, B>
sourceimpl<T: TypeName + FromNapiValue + ToNapiValue> From<Either<T, JsNull>> for Option<T>
impl<T: TypeName + FromNapiValue + ToNapiValue> From<Either<T, JsNull>> for Option<T>
sourceimpl<T: TypeName + FromNapiValue + ToNapiValue> From<Either<T, JsUndefined>> for Option<T>
impl<T: TypeName + FromNapiValue + ToNapiValue> 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 + ToNapiValue, B: TypeName + FromNapiValue + ToNapiValue> FromNapiValue for Either<A, B>
impl<A: TypeName + FromNapiValue + ToNapiValue, B: TypeName + FromNapiValue + ToNapiValue> 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
sourceimpl<A: TypeName + FromNapiValue + ToNapiValue, B: TypeName + FromNapiValue + ToNapiValue> ToNapiValue for Either<A, B>
impl<A: TypeName + FromNapiValue + ToNapiValue, B: TypeName + FromNapiValue + 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: TypeName + FromNapiValue + ToNapiValue, B: TypeName + FromNapiValue + ToNapiValue> TypeName for Either<A, B>
impl<A: TypeName + FromNapiValue + ToNapiValue, B: TypeName + FromNapiValue + ToNapiValue> TypeName for Either<A, B>
impl<A: Copy + TypeName + FromNapiValue + ToNapiValue, B: Copy + TypeName + FromNapiValue + ToNapiValue> Copy for Either<A, B>
Auto Trait Implementations
impl<A, B> RefUnwindSafe for Either<A, B> where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Either<A, B> where
A: Send,
B: Send,
impl<A, B> Sync for Either<A, B> where
A: Sync,
B: Sync,
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more