Enum choice::Choice [−][src]
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
The "left" case.
The "right" case.
Implementations
impl<A, B> Choice<A, B>
[src]
pub fn new(choice: A) -> Self
[src]
Constructs a Choice
between two types, where the "decision" is of the first type.
pub fn or<L>(self) -> Choice<L, Choice<A, B>>
[src]
Wraps an existing Choice
with an additional chooseable type.
impl<A> Choice<A, Never>
[src]
Trait Implementations
impl<L: Clone, R: Clone> Clone for Choice<L, R>
[src]
impl<L: Copy, R: Copy> Copy for Choice<L, R>
[src]
impl<A, B> Debug for Choice<A, B> where
A: Debug,
B: Debug,
[src]
A: Debug,
B: Debug,
impl<'de, L, R> Deserialize<'de> for Choice<L, R> where
L: Deserialize<'de>,
R: Deserialize<'de>,
[src]
L: Deserialize<'de>,
R: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<A, B> Display for Choice<A, B> where
A: Display,
B: Display,
[src]
A: Display,
B: Display,
impl<L: Eq, R: Eq> Eq for Choice<L, R>
[src]
impl<L: Hash, R: Hash> Hash for Choice<L, R>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<L: Ord, R: Ord> Ord for Choice<L, R>
[src]
fn cmp(&self, other: &Choice<L, R>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<L: PartialEq, R: PartialEq> PartialEq<Choice<L, R>> for Choice<L, R>
[src]
impl<L: PartialOrd, R: PartialOrd> PartialOrd<Choice<L, R>> for Choice<L, R>
[src]
fn partial_cmp(&self, other: &Choice<L, R>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<L, R> Serialize for Choice<L, R> where
L: Serialize,
R: Serialize,
[src]
L: Serialize,
R: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<L, R> StructuralEq for Choice<L, R>
[src]
impl<L, R> StructuralPartialEq for Choice<L, R>
[src]
Auto Trait Implementations
impl<L, R> RefUnwindSafe for Choice<L, R> where
L: RefUnwindSafe,
R: RefUnwindSafe,
[src]
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Choice<L, R> where
L: Send,
R: Send,
[src]
L: Send,
R: Send,
impl<L, R> Sync for Choice<L, R> where
L: Sync,
R: Sync,
[src]
L: Sync,
R: Sync,
impl<L, R> Unpin for Choice<L, R> where
L: Unpin,
R: Unpin,
[src]
L: Unpin,
R: Unpin,
impl<L, R> UnwindSafe for Choice<L, R> where
L: UnwindSafe,
R: UnwindSafe,
[src]
L: UnwindSafe,
R: 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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
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.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
pub 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>,