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<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§
source§impl<L: Ord, R: Ord> Ord for Or<L, R>
impl<L: Ord, R: Ord> Ord for Or<L, R>
source§impl<L: PartialEq, R: PartialEq> PartialEq<Or<L, R>> for Or<L, R>
impl<L: PartialEq, R: PartialEq> PartialEq<Or<L, R>> for Or<L, R>
source§impl<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>
1.0.0 · source§fn 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