Struct show_notes::e031::unions::Either
source · pub struct Either<L: Copy, R: Copy> {
pub tag: Tag,
pub value: EitherValue<L, R>,
}
Expand description
Uses an enum
and a union
to get close to a regular Rust enum.
Roughly, because the compiler won’t check you for exhaustiveness, or even make sure you’re using the tag and value pair the way you should!
Fields§
§tag: Tag
§value: EitherValue<L, R>
Auto Trait Implementations§
impl<L, R> Freeze for Either<L, R>
impl<L, R> RefUnwindSafe for Either<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Either<L, R>
impl<L, R> Sync for Either<L, R>
impl<L, R> Unpin for Either<L, R>
impl<L, R> UnwindSafe for Either<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