pub enum Or<L, R> {
Left(L),
Right(R),
Both(L, R),
}
Expand description
Holds an L
, or an R
, or both
Variants
Left(L)
Just an L
Right(R)
Just an R
Both(L, R)
Both an L
and an R
Implementations
sourceimpl<L, R> Or<L, R>
impl<L, R> Or<L, R>
sourcepub fn new(l: Option<L>, r: Option<R>) -> Option<Or<L, R>>
pub fn new(l: Option<L>, r: Option<R>) -> Option<Or<L, R>>
Construct an Or<L, R>
if at least one argument is Some
sourcepub fn split(self) -> (Option<L>, Option<R>)
pub fn split(self) -> (Option<L>, Option<R>)
Destructure into two Option
s, where either or both are Some
Trait Implementations
sourceimpl<L, R> Ord for Or<L, R>where
L: Ord,
R: Ord,
impl<L, R> Ord for Or<L, R>where
L: Ord,
R: Ord,
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<L, R> PartialEq<Or<L, R>> for Or<L, R>where
L: PartialEq<L>,
R: PartialEq<R>,
impl<L, R> PartialEq<Or<L, R>> for Or<L, R>where
L: PartialEq<L>,
R: PartialEq<R>,
sourceimpl<L, R> PartialOrd<Or<L, R>> for Or<L, R>where
L: PartialOrd<L>,
R: PartialOrd<R>,
impl<L, R> PartialOrd<Or<L, R>> for Or<L, R>where
L: PartialOrd<L>,
R: PartialOrd<R>,
sourcefn partial_cmp(&self, other: &Or<L, R>) -> Option<Ordering>
fn partial_cmp(&self, other: &Or<L, R>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<L, R> Copy for Or<L, R>where
L: Copy,
R: Copy,
impl<L, R> Eq for Or<L, R>where
L: Eq,
R: Eq,
impl<L, R> Query for Or<L, R>where
L: Query,
R: Query,
impl<L, R> StructuralEq for Or<L, R>
impl<L, R> StructuralPartialEq for Or<L, R>
Auto Trait Implementations
impl<L, R> RefUnwindSafe for Or<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Or<L, R>where
L: Send,
R: Send,
impl<L, R> Sync for Or<L, R>where
L: Sync,
R: Sync,
impl<L, R> Unpin for Or<L, R>where
L: Unpin,
R: Unpin,
impl<L, R> UnwindSafe for Or<L, R>where
L: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.