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§
Required Methods§
sourcefn or_error(self, error: Self::Error) -> Outcome
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.
sourcefn or_forward(self, forward: Self::Forward) -> Outcome
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.