pub enum Sum<L, R> {
Left(L),
Right(R),
}Expand description
A sum of two types (enum with two variants).
Sums chain to represent multiple enum variants:
Sum<A, Sum<B, Sum<C, Void>>> represents an enum with variants A, B, C.
Variants§
Trait Implementations§
impl<L: Copy, R: Copy> Copy for Sum<L, R>
impl<L: Eq, R: Eq> Eq for Sum<L, R>
impl<L, R> StructuralPartialEq for Sum<L, R>
Auto Trait Implementations§
impl<L, R> Freeze for Sum<L, R>
impl<L, R> RefUnwindSafe for Sum<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Sum<L, R>
impl<L, R> Sync for Sum<L, R>
impl<L, R> Unpin for Sum<L, R>
impl<L, R> UnsafeUnpin for Sum<L, R>where
L: UnsafeUnpin,
R: UnsafeUnpin,
impl<L, R> UnwindSafe for Sum<L, R>where
L: UnwindSafe,
R: 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