Enum tear::Moral [−][src]
A notion of good and bad for the terror!
macro
Variants
The good
And the bad
Implementations
impl<Y, N> Moral<Y, N>
[src]
pub fn good(self) -> Option<Y>
[src]
Gets the Good(Y)
variant as Option<Y>
pub fn bad(self) -> Option<N>
[src]
Gets the Bad(N)
variant as Option<N>
pub fn into_valret(self) -> ValRet<Y, N>
[src]
Convert to ValRet
Maps Good to Val and Bad to Ret.
pub fn into_result(self) -> Result<Y, N>
[src]
Convert to Result. Use Judge::result
instead
Maps Good to Ok and Bad to Err.
pub fn resume_or_else<B>(
self,
f: impl FnOnce(N) -> Looping<Y, B>
) -> Looping<Y, B>
[src]
self,
f: impl FnOnce(N) -> Looping<Y, B>
) -> Looping<Y, B>
Trait Implementations
impl<Y: Clone, N: Clone> Clone for Moral<Y, N>
[src]
fn clone(&self) -> Moral<Y, N>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Y: Debug, N: Debug> Debug for Moral<Y, N>
[src]
impl<Y, N> Judge for Moral<Y, N>
[src]
type Positive = Y
This is considered Good
type Negative = N
This is considered Bad
fn into_moral(self) -> Moral<Y, N>
[src]
fn from_good(v: Y) -> Self
[src]
fn from_bad(v: N) -> Self
[src]
fn result(self) -> Result<Self::Positive, Self::Negative>
[src]
impl<Y: PartialEq, N: PartialEq> PartialEq<Moral<Y, N>> for Moral<Y, N>
[src]
impl<Y, N> StructuralPartialEq for Moral<Y, N>
[src]
Auto Trait Implementations
impl<Y, N> Send for Moral<Y, N> where
N: Send,
Y: Send,
N: Send,
Y: Send,
impl<Y, N> Sync for Moral<Y, N> where
N: Sync,
Y: Sync,
N: Sync,
Y: Sync,
impl<Y, N> Unpin for Moral<Y, N> where
N: Unpin,
Y: Unpin,
N: Unpin,
Y: Unpin,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, E, Me> Return for Me where
Me: Judge<Positive = T, Negative = E>,
[src]
Me: Judge<Positive = T, Negative = E>,
type Value = T
The Val in ValRet
type Returned = E
The Ret in ValRet
pub fn into_valret(Self) -> ValRet<T, E>
[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>,