pub enum Or<L, R> {
Left(L),
Right(R),
Both(L, R),
}
Expand description
Holds an L
, or an R
, or both
Variants§
Implementations§
Source§impl<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§
Source§impl<L, R> Ord for Or<L, R>
impl<L, R> Ord for Or<L, R>
Source§impl<L, R> PartialOrd for Or<L, R>where
L: PartialOrd,
R: PartialOrd,
impl<L, R> PartialOrd for Or<L, R>where
L: PartialOrd,
R: PartialOrd,
impl<L, R> Copy for Or<L, R>
impl<L, R> Eq for Or<L, R>
impl<L, R> StructuralPartialEq for Or<L, R>
Auto Trait Implementations§
impl<L, R> Freeze for Or<L, R>
impl<L, R> RefUnwindSafe for Or<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Or<L, R>
impl<L, R> Sync for Or<L, R>
impl<L, R> Unpin for Or<L, R>
impl<L, R> UnwindSafe for Or<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.