pub enum OneOrBoth<L, R> {
Left(L),
Both(L, R),
Right(R),
}
Expand description
A struct indicating either A or B or Both, but not neither - at least one must be present Useful when indicating support for Le or BrEdr, where dual mode is also supported but we require at least one. This avoids extra error checking that would be required if two options were used.
Variants§
Implementations§
Trait Implementations§
impl<L, R> StructuralPartialEq for OneOrBoth<L, R>
Auto Trait Implementations§
impl<L, R> Freeze for OneOrBoth<L, R>
impl<L, R> RefUnwindSafe for OneOrBoth<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for OneOrBoth<L, R>
impl<L, R> Sync for OneOrBoth<L, R>
impl<L, R> Unpin for OneOrBoth<L, R>
impl<L, R> UnwindSafe for OneOrBoth<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,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more