[−][src]Enum mod_utilities::Either
A wrapper for a value that is either one type or another
Similar to Result, but without the semantic connotations
Variants
Implementations
impl<A, B> Either<A, B>
[src]
pub fn is_a(&self) -> bool
[src]
Determine if an Either is the A variant
pub fn is_b(&self) -> bool
[src]
Determine if an Either is the B variant
pub fn into_a(self) -> Option<A>
[src]
pub fn into_b(self) -> Option<B>
[src]
Convert an Either<A, B> to an Option
Trait Implementations
impl<A: Clone, B: Clone> Clone for Either<A, B>
[src]
impl<A: Copy, B: Copy> Copy for Either<A, B>
[src]
impl<A: Debug, B: Debug> Debug for Either<A, B>
[src]
impl<A: Eq, B: Eq> Eq for Either<A, B>
[src]
impl<A: Ord, B: Ord> Ord for Either<A, B>
[src]
fn cmp(&self, other: &Either<A, B>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<A: PartialEq, B: PartialEq> PartialEq<Either<A, B>> for Either<A, B>
[src]
impl<A: PartialOrd, B: PartialOrd> PartialOrd<Either<A, B>> for Either<A, B>
[src]
fn partial_cmp(&self, other: &Either<A, B>) -> Option<Ordering>
[src]
fn lt(&self, other: &Either<A, B>) -> bool
[src]
fn le(&self, other: &Either<A, B>) -> bool
[src]
fn gt(&self, other: &Either<A, B>) -> bool
[src]
fn ge(&self, other: &Either<A, B>) -> bool
[src]
impl<A, B> StructuralEq for Either<A, B>
[src]
impl<A, B> StructuralPartialEq for Either<A, B>
[src]
Auto Trait Implementations
impl<A, B> RefUnwindSafe for Either<A, B> where
A: RefUnwindSafe,
B: RefUnwindSafe,
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Either<A, B> where
A: Send,
B: Send,
A: Send,
B: Send,
impl<A, B> Sync for Either<A, B> where
A: Sync,
B: Sync,
A: Sync,
B: Sync,
impl<A, B> Unpin for Either<A, B> where
A: Unpin,
B: Unpin,
A: Unpin,
B: Unpin,
impl<A, B> UnwindSafe for Either<A, B> where
A: UnwindSafe,
B: UnwindSafe,
A: UnwindSafe,
B: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,