Enum malachite_base::unions::Union2
source · pub enum Union2<A, B> {
A(A),
B(B),
}
Expand description
This is a union, or sum type, of $n$ values. It is essentially a generic enum.
Variants§
Implementations§
Trait Implementations§
source§impl<A: FromStr, B: FromStr> FromStr for Union2<A, B>
impl<A: FromStr, B: FromStr> FromStr for Union2<A, B>
source§impl<A: Ord, B: Ord> Ord for Union2<A, B>
impl<A: Ord, B: Ord> Ord for Union2<A, B>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<A: PartialOrd, B: PartialOrd> PartialOrd for Union2<A, B>
impl<A: PartialOrd, B: PartialOrd> PartialOrd for Union2<A, B>
impl<A: Copy, B: Copy> Copy for Union2<A, B>
impl<A: Eq, B: Eq> Eq for Union2<A, B>
impl<A, B> StructuralPartialEq for Union2<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for Union2<A, B>
impl<A, B> RefUnwindSafe for Union2<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Union2<A, B>
impl<A, B> Sync for Union2<A, B>
impl<A, B> Unpin for Union2<A, B>
impl<A, B> UnwindSafe for Union2<A, B>where
A: UnwindSafe,
B: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more