pub enum Or3<T1, T2, T3> {
T1(T1),
T2(T2),
T3(T3),
}
Expand description
Or3
is an enum representing a value that can be either of 3 types, T1 … T3.
Variants§
Implementations§
Source§impl<T1, T2, T3> Or3<T1, T2, T3>
impl<T1, T2, T3> Or3<T1, T2, T3>
Sourcepub fn as_t1(self) -> Option<T1>
pub fn as_t1(self) -> Option<T1>
Converts the enum to an Option containing the T1 value, if it is of type T1.
Sourcepub fn as_t2(self) -> Option<T2>
pub fn as_t2(self) -> Option<T2>
Converts the enum to an Option containing the T2 value, if it is of type T2.
Sourcepub fn as_t3(self) -> Option<T3>
pub fn as_t3(self) -> Option<T3>
Converts the enum to an Option containing the T3 value, if it is of type T3.
Sourcepub fn map_t1<F, B>(self, f: F) -> Or3<B, T2, T3>where
F: FnOnce(T1) -> B,
pub fn map_t1<F, B>(self, f: F) -> Or3<B, T2, T3>where
F: FnOnce(T1) -> B,
Transforms the T1 value of the enum using a provided function, maintaining other types as is.
Sourcepub fn map_t2<F, B>(self, f: F) -> Or3<T1, B, T3>where
F: FnOnce(T2) -> B,
pub fn map_t2<F, B>(self, f: F) -> Or3<T1, B, T3>where
F: FnOnce(T2) -> B,
Transforms the T2 value of the enum using a provided function, maintaining other types as is.
Trait Implementations§
impl<T1: Copy, T2: Copy, T3: Copy> Copy for Or3<T1, T2, T3>
Auto Trait Implementations§
impl<T1, T2, T3> Freeze for Or3<T1, T2, T3>
impl<T1, T2, T3> RefUnwindSafe for Or3<T1, T2, T3>
impl<T1, T2, T3> Send for Or3<T1, T2, T3>
impl<T1, T2, T3> Sync for Or3<T1, T2, T3>
impl<T1, T2, T3> Unpin for Or3<T1, T2, T3>
impl<T1, T2, T3> UnwindSafe for Or3<T1, T2, T3>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more