pub enum Choice<L, R> {
L(L),
R(R),
}
Expand description
Represents a choice between two types, which you can compose to represent a choice between more
types – Choice<C, Choice<A, B>>
for instance.
See the top-level crate docs for more details.
Variants§
Implementations§
Trait Implementations§
Source§impl<'de, L, R> Deserialize<'de> for Choice<L, R>where
L: Deserialize<'de>,
R: Deserialize<'de>,
impl<'de, L, R> Deserialize<'de> for Choice<L, R>where
L: Deserialize<'de>,
R: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<L: Ord, R: Ord> Ord for Choice<L, R>
impl<L: Ord, R: Ord> Ord for Choice<L, R>
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<L: PartialOrd, R: PartialOrd> PartialOrd for Choice<L, R>
impl<L: PartialOrd, R: PartialOrd> PartialOrd for Choice<L, R>
impl<L: Copy, R: Copy> Copy for Choice<L, R>
impl<L: Eq, R: Eq> Eq for Choice<L, R>
impl<L, R> StructuralPartialEq for Choice<L, R>
Auto Trait Implementations§
impl<L, R> Freeze for Choice<L, R>
impl<L, R> RefUnwindSafe for Choice<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Choice<L, R>
impl<L, R> Sync for Choice<L, R>
impl<L, R> Unpin for Choice<L, R>
impl<L, R> UnwindSafe for Choice<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