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<Self>
pub fn new(l: Option<L>, r: Option<R>) -> Option<Self>
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: Ord, R: Ord> Ord for Or<L, R>
impl<L: Ord, R: Ord> Ord for Or<L, R>
sourceimpl<L: PartialOrd, R: PartialOrd> PartialOrd<Or<L, R>> for Or<L, R>
impl<L: PartialOrd, R: PartialOrd> PartialOrd<Or<L, R>> for Or<L, R>
sourcefn partial_cmp(&self, other: &Or<L, R>) -> Option<Ordering>
fn partial_cmp(&self, other: &Or<L, R>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
impl<L: Copy, R: Copy> Copy for Or<L, R>
impl<L: Eq, R: Eq> Eq for Or<L, R>
impl<L: Query, R: Query> Query for Or<L, R>
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more