Trait finchers_ext::EndpointResultExt [] [src]

pub trait EndpointResultExt<A, B>: Endpoint<Output = Result<A, B>> + Sized {
    fn as_ok<T>(self) -> Self
    where
        Self::Output: IsResult<Ok = T>
, { ... }
fn as_err<E>(self) -> Self
    where
        Self::Output: IsResult<Err = E>
, { ... }
fn map_ok<F, U>(self, f: F) -> MapOk<Self, F>
    where
        F: FnOnce(A) -> U + Clone + Send + Sync
, { ... }
fn map_err<F, U>(self, f: F) -> MapErr<Self, F>
    where
        F: FnOnce(B) -> U + Clone + Send + Sync
, { ... }
fn err_into<U>(self) -> ErrInto<Self, U>
    where
        B: Into<U>
, { ... }
fn and_then<F, U>(self, f: F) -> AndThen<Self, F>
    where
        F: FnOnce(A) -> Result<U, B> + Clone + Send + Sync
, { ... }
fn or_else<F, U>(self, f: F) -> OrElse<Self, F>
    where
        F: FnOnce(B) -> Result<A, U> + Clone + Send + Sync
, { ... }
fn unwrap_ok(self) -> UnwrapOk<Self>
    where
        B: Into<Error>
, { ... } }

A set of extension methods which is available when the output value is a Result.

Provided Methods

Annotate that the successful type of associated type Output is equal to T.

Annotate that the error type of associated type Output is equal to E.

Create an endpoint which will map the successful value to a new type with given function.

Create an endpoint which will map the error value to a new type with given function.

Create an endpoint which will convert the error value to a new type.

Create an endpoint which will map the successful value to a Result with given function.

Create an endpoint which will map the error value to a Result with given function.

Create an endpoint which will return the content of an Ok.

The term "unwrap" does not means that an unwinding will occur if the value is an Err. Instead, the error value will be converted to an Error and handled the state internally.

Implementors