Trait tear::Judge [−][src]
Convert from and to Moral
. Used for the macro map syntax.
This mirrors the ops::Try
trait.
It is used for the =>
mapping syntax of macros, to differentiate the value we want to keep from
the value we want to map through the function.
Associated Types
Loading content...Required methods
fn into_moral(self) -> Moral<Self::Positive, Self::Negative>
[src]
Convert to Moral
fn from_good(v: Self::Positive) -> Self
[src]
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
[src]
Wraps a bad value into itself
For example Result::Err(e)
and Judge::from_bad(e)
are equivalent. Useful for converting types.
Provided methods
Loading content...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 = Maru
fn into_moral(self) -> Moral<T, Maru>
[src]
fn from_good(v: T) -> Self
[src]
fn from_bad(_: Maru) -> Self
[src]
impl<T, E> Judge for Result<T, E>
[src]
Implementation of Judge for Result based on its implementation of Try