rocket::outcome

Trait 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>