[−][src]Enum pour::BinaryResult
A binary result, which can be either the left value, the right value, or a new value
Used to avoid cloning
Variants
A new value
The left value
The right value
Either the left or the right, don't care
Implementations
impl<T> BinaryResult<T>
[src]
pub fn or_left(opt: Option<T>) -> BinaryResult<T>
[src]
Convert an Option
to a New
or a Left
pub fn or_right(opt: Option<T>) -> BinaryResult<T>
[src]
Convert an Option
to a New
or a Right
pub fn unwrap(self) -> T
[src]
Unwrap a BinaryResult<T>
, panicking if not New
pub fn unwrap_or_clone(self, left: &T, right: &T) -> T where
T: Clone,
[src]
T: Clone,
Unwrap a BinaryResult<T>
, cloning if not New
pub fn map<F, U>(self, func: F) -> BinaryResult<U> where
F: FnOnce(T) -> U,
[src]
F: FnOnce(T) -> U,
Map a BinaryResult
(as a functor)
pub fn swap_sides(self) -> BinaryResult<T>
[src]
Swap the sides of a BinaryResult
, i.e. flip Left
and Right
Trait Implementations
impl<T: Clone> Clone for BinaryResult<T>
[src]
fn clone(&self) -> BinaryResult<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for BinaryResult<T>
[src]
impl<T: Debug> Debug for BinaryResult<T>
[src]
impl<T: Eq> Eq for BinaryResult<T>
[src]
impl<T: Hash> Hash for BinaryResult<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: PartialEq> PartialEq<BinaryResult<T>> for BinaryResult<T>
[src]
fn eq(&self, other: &BinaryResult<T>) -> bool
[src]
fn ne(&self, other: &BinaryResult<T>) -> bool
[src]
impl<T> StructuralEq for BinaryResult<T>
[src]
impl<T> StructuralPartialEq for BinaryResult<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for BinaryResult<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for BinaryResult<T> where
T: Send,
T: Send,
impl<T> Sync for BinaryResult<T> where
T: Sync,
T: Sync,
impl<T> Unpin for BinaryResult<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for BinaryResult<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CallHasher for T where
T: Hash,
[src]
T: Hash,
impl<T> Erasable for T
pub unsafe fn unerase(this: NonNull<Erased>) -> NonNull<T>
pub const ACK_1_1_0: bool
fn erase(this: NonNull<Self>) -> NonNull<Erased>
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,