Enum Or6

Source
pub enum Or6<T1, T2, T3, T4, T5, T6> {
    T1(T1),
    T2(T2),
    T3(T3),
    T4(T4),
    T5(T5),
    T6(T6),
}
Expand description

Or6 is an enum representing a value that can be either of 6 types, T1 … T6.

Variants§

§

T1(T1)

§

T2(T2)

§

T3(T3)

§

T4(T4)

§

T5(T5)

§

T6(T6)

Implementations§

Source§

impl<T1, T2, T3, T4, T5, T6> Or6<T1, T2, T3, T4, T5, T6>

Source

pub fn is_t1(&self) -> bool

Returns true if the enum is of type T1.

Source

pub fn is_t2(&self) -> bool

Returns true if the enum is of type T2.

Source

pub fn is_t3(&self) -> bool

Returns true if the enum is of type T3.

Source

pub fn is_t4(&self) -> bool

Returns true if the enum is of type T4.

Source

pub fn is_t5(&self) -> bool

Returns true if the enum is of type T5.

Source

pub fn is_t6(&self) -> bool

Returns true if the enum is of type T6.

Source

pub fn as_t1(self) -> Option<T1>

Converts the enum to an Option containing the T1 value, if it is of type T1.

Source

pub fn as_t2(self) -> Option<T2>

Converts the enum to an Option containing the T2 value, if it is of type T2.

Source

pub fn as_t3(self) -> Option<T3>

Converts the enum to an Option containing the T3 value, if it is of type T3.

Source

pub fn as_t4(self) -> Option<T4>

Converts the enum to an Option containing the T4 value, if it is of type T4.

Source

pub fn as_t5(self) -> Option<T5>

Converts the enum to an Option containing the T5 value, if it is of type T5.

Source

pub fn as_t6(self) -> Option<T6>

Converts the enum to an Option containing the T6 value, if it is of type T6.

Source

pub fn map_t1<F, B>(self, f: F) -> Or6<B, T2, T3, T4, T5, T6>
where F: FnOnce(T1) -> B,

Transforms the T1 value of the enum using a provided function, maintaining other types as is.

Source

pub fn map_t2<F, B>(self, f: F) -> Or6<T1, B, T3, T4, T5, T6>
where F: FnOnce(T2) -> B,

Transforms the T2 value of the enum using a provided function, maintaining other types as is.

Source

pub fn map_t3<F, B>(self, f: F) -> Or6<T1, T2, B, T4, T5, T6>
where F: FnOnce(T3) -> B,

Transforms the T3 value of the enum using a provided function, maintaining other types as is.

Source

pub fn map_t4<F, B>(self, f: F) -> Or6<T1, T2, T3, B, T5, T6>
where F: FnOnce(T4) -> B,

Transforms the T4 value of the enum using a provided function, maintaining other types as is.

Source

pub fn map_t5<F, B>(self, f: F) -> Or6<T1, T2, T3, T4, B, T6>
where F: FnOnce(T5) -> B,

Transforms the T5 value of the enum using a provided function, maintaining other types as is.

Source

pub fn map_t6<F, B>(self, f: F) -> Or6<T1, T2, T3, T4, T5, B>
where F: FnOnce(T6) -> B,

Transforms the T6 value of the enum using a provided function, maintaining other types as is.

Source

pub fn fold<T, F0, F1, F2, F3, F4, F5, F6>( self, f1: F1, f2: F2, f3: F3, f4: F4, f5: F5, f6: F6, ) -> T
where F1: FnOnce(T1) -> T, F2: FnOnce(T2) -> T, F3: FnOnce(T3) -> T, F4: FnOnce(T4) -> T, F5: FnOnce(T5) -> T, F6: FnOnce(T6) -> T,

Consolidates the Or6 enum into a single value of type T, by applying provided functions.

Source§

impl<T1, T2, T3, T4, T5, T6> Or6<T1, T2, T3, T4, T5, T6>
where T1: 'static, T2: 'static, T3: 'static, T4: 'static, T5: 'static, T6: 'static,

Extension to Or6 to check if the enum’s type matches a arbitrary type. Currently, these functions depend on the rustc intrinsics, and the constraints of the intrinsics require that the type must satisfy 'static'.

Source

pub fn is_type<T: 'static>(&self) -> bool

Auto Trait Implementations§

§

impl<T1, T2, T3, T4, T5, T6> Freeze for Or6<T1, T2, T3, T4, T5, T6>
where T1: Freeze, T2: Freeze, T3: Freeze, T4: Freeze, T5: Freeze, T6: Freeze,

§

impl<T1, T2, T3, T4, T5, T6> RefUnwindSafe for Or6<T1, T2, T3, T4, T5, T6>

§

impl<T1, T2, T3, T4, T5, T6> Send for Or6<T1, T2, T3, T4, T5, T6>
where T1: Send, T2: Send, T3: Send, T4: Send, T5: Send, T6: Send,

§

impl<T1, T2, T3, T4, T5, T6> Sync for Or6<T1, T2, T3, T4, T5, T6>
where T1: Sync, T2: Sync, T3: Sync, T4: Sync, T5: Sync, T6: Sync,

§

impl<T1, T2, T3, T4, T5, T6> Unpin for Or6<T1, T2, T3, T4, T5, T6>
where T1: Unpin, T2: Unpin, T3: Unpin, T4: Unpin, T5: Unpin, T6: Unpin,

§

impl<T1, T2, T3, T4, T5, T6> UnwindSafe for Or6<T1, T2, T3, T4, T5, T6>
where T1: UnwindSafe, T2: UnwindSafe, T3: UnwindSafe, T4: UnwindSafe, T5: UnwindSafe, T6: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.