Enum orx_closure::OneOf2

source ·
pub enum OneOf2<C1, C2> {
    Variant1(C1),
    Variant2(C2),
}
Expand description

One of the two variants.

Examples

use orx_closure::*;

let _ = OneOf2::<i32, bool>::Variant1(42);
let _ = OneOf2::<i32, bool>::Variant2(true);

Variants§

§

Variant1(C1)

First variant.

§

Variant2(C2)

Second variant.

Trait Implementations§

source§

impl<C1: Clone, C2: Clone> Clone for OneOf2<C1, C2>

source§

fn clone(&self) -> OneOf2<C1, C2>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<C1: Debug, C2: Debug> Debug for OneOf2<C1, C2>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<C1: PartialEq, C2: PartialEq> PartialEq for OneOf2<C1, C2>

source§

fn eq(&self, other: &OneOf2<C1, C2>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<C1: Eq, C2: Eq> Eq for OneOf2<C1, C2>

source§

impl<C1, C2> StructuralEq for OneOf2<C1, C2>

source§

impl<C1, C2> StructuralPartialEq for OneOf2<C1, C2>

Auto Trait Implementations§

§

impl<C1, C2> RefUnwindSafe for OneOf2<C1, C2>where C1: RefUnwindSafe, C2: RefUnwindSafe,

§

impl<C1, C2> Send for OneOf2<C1, C2>where C1: Send, C2: Send,

§

impl<C1, C2> Sync for OneOf2<C1, C2>where C1: Sync, C2: Sync,

§

impl<C1, C2> Unpin for OneOf2<C1, C2>where C1: Unpin, C2: Unpin,

§

impl<C1, C2> UnwindSafe for OneOf2<C1, C2>where C1: UnwindSafe, C2: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.