[−][src]Trait tear::Judge
Convert from and to Moral. Used in the rip! macro.
This is inspired by the std::ops::Try trait.
Associated Types
Loading content...Required methods
fn into_moral(self) -> Moral<Self::Positive, Self::Negative>
Convert to Moral
fn from_good(v: Self::Positive) -> Self
Wraps a good value into itself
For example Result::Ok(v)
and Judge::from_good(v)
are equivalent. Useful for converting types.
fn from_bad(v: Self::Negative) -> Self
Wraps a bad value into itself
For example Result::Err(e)
and Judge::from_bad(e)
are equivalent. Useful for converting types.
Implementations on Foreign Types
impl<T> Judge for Option<T>
[src]
Implementation of Judge for Option based on its implementation of Try
type Positive = T
type Negative = ()
fn into_moral(self) -> Moral<T, ()>
[src]
fn from_good(v: T) -> Self
[src]
fn from_bad(_: ()) -> Self
[src]
impl<T, E> Judge for Result<T, E>
[src]
Implementation of Judge for Result based on its implementation of Try