Trait rocket::outcome::IntoOutcome

source ·
pub trait IntoOutcome<Outcome> {
    type Error: Sized;
    type Forward: Sized;

    // Required methods
    fn or_error(self, error: Self::Error) -> Outcome;
    fn or_forward(self, forward: Self::Forward) -> Outcome;
}
Expand description

Conversion trait from some type into an Outcome type.

Required Associated Types§

source

type Error: Sized

The type to use when returning an Outcome::Error.

source

type Forward: Sized

The type to use when returning an Outcome::Forward.

Required Methods§

source

fn or_error(self, error: Self::Error) -> Outcome

Converts self into an Outcome. If self represents a success, an Outcome::Success is returned. Otherwise, an Outcome::Error is returned with error as the inner value.

source

fn or_forward(self, forward: Self::Forward) -> Outcome

Converts self into an Outcome. If self represents a success, an Outcome::Success is returned. Otherwise, an Outcome::Forward is returned with forward as the inner value.

Implementors§

source§

impl<'r, 'o: 'r> IntoOutcome<Outcome<Response<'r>, Status, (Data<'r>, Status)>> for rocket::response::Result<'o>

source§

impl<'r, T: FromData<'r>> IntoOutcome<Outcome<T, (Status, <T as FromData<'r>>::Error), (Data<'r>, Status)>> for rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result<T, T::Error>

source§

impl<S, E> IntoOutcome<Outcome<S, (Status, E), Status>> for rocket::mtls::oid::asn1_rs::nom::lib::std::result::Result<S, E>

source§

impl<S, E, F> IntoOutcome<Outcome<S, E, F>> for Option<S>