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§
Trait Implementations§
source§impl<'de, T, E> Deserialize<'de> for Result<T, E>where
T: Deserialize<'de>,
E: Deserialize<'de>,
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>,
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>
impl<'r, T: FromData<'r> + 'r> FromData<'r> for Result<T, T::Error>
§type Error = Infallible
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,
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 moresource§impl<'a, T: FromParam<'a>> FromParam<'a> for Result<T, T::Error>
impl<'a, T: FromParam<'a>> FromParam<'a> for Result<T, T::Error>
§type Error = Infallible
type Error = Infallible
The associated error to be returned if parsing/validation fails.
source§impl<'r, T: FromRequest<'r>> FromRequest<'r> for Result<T, T::Error>
impl<'r, T: FromRequest<'r>> FromRequest<'r> for Result<T, T::Error>
§type Error = Infallible
type Error = Infallible
The associated error to be returned if derivation fails.
source§impl<'r, T: FromSegments<'r>> FromSegments<'r> for Result<T, T::Error>
impl<'r, T: FromSegments<'r>> FromSegments<'r> for Result<T, T::Error>
source§impl<A, E, T> FromUriParam<Path, A> for Result<T, E>where
T: FromUriParam<Path, A>,
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
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
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>,
impl<A, E, T> FromUriParam<Query, Option<A>> for Result<T, E>where T: FromUriParam<Query, A>,
source§fn from_uri_param(
param: Option<A>
) -> <Result<T, E> as FromUriParam<Query, Option<A>>>::Target
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>,
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>
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
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>
impl<'r, S, E> IntoOutcome<S, (Status, E), (Data<'r>, Status)> for Result<S, E>
source§fn into_outcome(self, status: Status) -> Outcome<'r, S, E>
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§impl<S, E> IntoOutcome<S, (Status, E), Status> for Result<S, E>
impl<S, E> IntoOutcome<S, (Status, E), Status> for Result<S, E>
source§fn into_outcome(self, status: Status) -> Outcome<S, E>
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>
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>,
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§impl<T, E> Serialize for Result<T, E>where
T: Serialize,
E: Serialize,
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,
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>,
impl<T, E> UriDisplay<Query> for Result<T, E>where T: UriDisplay<Query>,
Defers to the UriDisplay<Query>
implementation for T
.