Type Alias rocket::form::Result

source ·
pub type Result<'v, T> = Result<T, Errors<'v>>;
Expand description

Type alias for Result with an error type of Errors.

Aliased Type§

enum Result<'v, T> {
    Ok(T),
    Err(Errors<'v>),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(Errors<'v>)

Contains the error value

Trait Implementations§

source§

impl<I, T: Contains<I>> Contains<I> for Result<'_, T>

source§

fn contains(&self, item: I) -> bool

Returns true if self contains item.
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<'v, T: FromForm<'v>> FromForm<'v> for Result<'v, T>

§

type Context = <T as FromForm<'v>>::Context

The form guard’s parsing context.
source§

fn init(opts: Options) -> Self::Context

Initializes and returns the parsing context for Self.
source§

fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>)

Processes the value field field.
source§

fn push_data<'life0, 'life1, 'async_trait>( ctxt: &'life0 mut Self::Context, field: DataField<'v, 'life1> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where Self: 'async_trait, 'v: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Processes the data field field.
source§

fn finalize(this: Self::Context) -> Result<'v, Self>

Finalizes parsing. Returns the parsed value when successful or collection of Errors otherwise.
source§

fn push_error(_ctxt: &mut Self::Context, _error: Error<'r>)

Processes the external form or field error _error. Read more
source§

fn default(opts: Options) -> Option<Self>

Returns a default value, if any, to use when a value is desired and parsing fails. 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<L, T: Len<L>> Len<L> for Result<'_, T>

source§

fn len(&self) -> L

The length of the value.
source§

fn len_into_u64(len: L) -> u64

Convert len into u64.
source§

fn zero_len() -> L

The zero value for L.
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>