Type Alias rocket::response::Result

source ·
pub type Result<'r> = Result<Response<'r>, Status>;
Expand description

Type alias for the Result of a Responder::respond_to() call.

Aliased Type§

enum Result<'r> {
    Ok(Response<'r>),
    Err(Status),
}

Variants§

§1.0.0

Ok(Response<'r>)

Contains the success value

§1.0.0

Err(Status)

Contains the error value

Trait Implementations§

source§

impl<'de, T, E> Deserialize<'de> for Result<T, E>where T: Deserialize<'de>, E: Deserialize<'de>,

source§

fn deserialize<D>( deserializer: D ) -> Result<Result<T, E>, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'r, T: FromData<'r> + 'r> FromData<'r> for Result<T, T::Error>

§

type Error = Infallible

The associated error to be returned when the guard fails.
source§

fn from_data<'life0, 'async_trait>( req: &'r Request<'life0>, data: Data<'r> ) -> Pin<Box<dyn Future<Output = Outcome<'r, Self>> + Send + 'async_trait>>where Self: 'async_trait, 'r: 'async_trait, 'life0: 'async_trait,

Asynchronously validates, parses, and converts an instance of Self from the incoming request body data. Read more
source§

impl<'a, T: FromParam<'a>> FromParam<'a> for Result<T, T::Error>

§

type Error = Infallible

The associated error to be returned if parsing/validation fails.
source§

fn from_param(param: &'a str) -> Result<Self, Self::Error>

Parses and validates an instance of Self from a path parameter string or returns an Error if parsing or validation fails.
source§

impl<'r, T: FromRequest<'r>> FromRequest<'r> for Result<T, T::Error>

§

type Error = Infallible

The associated error to be returned if derivation fails.
source§

fn from_request<'life0, 'async_trait>( request: &'r Request<'life0> ) -> Pin<Box<dyn Future<Output = Outcome<Self, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'r: 'async_trait, 'life0: 'async_trait,

Derives an instance of Self from the incoming request metadata. Read more
source§

impl<'r, T: FromSegments<'r>> FromSegments<'r> for Result<T, T::Error>

§

type Error = Infallible

The associated error to be returned when parsing fails.
source§

fn from_segments( segments: Segments<'r, Path> ) -> Result<Result<T, T::Error>, Self::Error>

Parses an instance of Self from many dynamic path parameter strings or returns an Error if one cannot be parsed.
source§

impl<A, E, T> FromUriParam<Path, A> for Result<T, E>where T: FromUriParam<Path, A>,

A no cost conversion allowing T to be used in place of an Result<T, E>.

§

type Target = <T as FromUriParam<Path, A>>::Target

The resulting type of this conversion.
source§

fn from_uri_param(param: A) -> <Result<T, E> as FromUriParam<Path, A>>::Target

Converts a value of type T into a value of type Self::Target. The resulting value of type Self::Target will be rendered into a URI using its UriDisplay implementation.
source§

impl<A, E, T> FromUriParam<Query, Option<A>> for Result<T, E>where T: FromUriParam<Query, A>,

§

type Target = Option<<T as FromUriParam<Query, A>>::Target>

The resulting type of this conversion.
source§

fn from_uri_param( param: Option<A> ) -> <Result<T, E> as FromUriParam<Query, Option<A>>>::Target

Converts a value of type T into a value of type Self::Target. The resulting value of type Self::Target will be rendered into a URI using its UriDisplay implementation.
source§

impl<A, E, T> FromUriParam<Query, Result<A, E>> for Result<T, E>where T: FromUriParam<Query, A>,

§

type Target = Result<<T as FromUriParam<Query, A>>::Target, E>

The resulting type of this conversion.
source§

fn from_uri_param( param: Result<A, E> ) -> <Result<T, E> as FromUriParam<Query, Result<A, E>>>::Target

Converts a value of type T into a value of type Self::Target. The resulting value of type Self::Target will be rendered into a URI using its UriDisplay implementation.
source§

impl<'r, S, E> IntoOutcome<S, (Status, E), (Data<'r>, Status)> for Result<S, E>

§

type Failure = Status

The type to use when returning an Outcome::Failure.
§

type Forward = (Data<'r>, Status)

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

fn into_outcome(self, status: Status) -> Outcome<'r, S, E>

Converts self into an Outcome. If self represents a success, an Outcome::Success is returned. Otherwise, an Outcome::Failure is returned with failure as the inner value.
source§

fn or_forward(self, (data, status): (Data<'r>, Status)) -> Outcome<'r, S, E>

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.
source§

impl<S, E> IntoOutcome<S, (Status, E), Status> for Result<S, E>

§

type Failure = Status

The type to use when returning an Outcome::Failure.
§

type Forward = Status

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

fn into_outcome(self, status: Status) -> Outcome<S, E>

Converts self into an Outcome. If self represents a success, an Outcome::Success is returned. Otherwise, an Outcome::Failure is returned with failure as the inner value.
source§

fn or_forward(self, status: Status) -> Outcome<S, E>

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.
source§

impl<'r, 'o: 'r, 't: 'o, 'e: 'o, T, E> Responder<'r, 'o> for Result<T, E>where T: Responder<'r, 't>, E: Responder<'r, 'e>,

Responds with the wrapped Responder in self, whether it is Ok or Err.

source§

fn respond_to(self, req: &'r Request<'_>) -> Result<'o>

Returns Ok if a Response could be generated successfully. Otherwise, returns an Err with a failing Status. Read more
source§

impl<T: Sentinel, E: Sentinel> Sentinel for Result<T, E>

source§

fn abort(rocket: &Rocket<Ignite>) -> bool

Returns true if launch should be aborted and false otherwise.
source§

impl<T, E> Serialize for Result<T, E>where T: Serialize, E: Serialize,

source§

fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T, E> UriDisplay<Query> for Result<T, E>where T: UriDisplay<Query>,

Defers to the UriDisplay<Query> implementation for T.

source§

fn fmt(&self, f: &mut Formatter<'_, Query>) -> Result<(), Error>

Formats self in a URI-safe manner using the given formatter.
source§

impl<T, E> Ignorable<Query> for Result<T, E>