rocket::form

Type Alias 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<'v, T: FromForm<'v>> FromForm<'v> for Result<'v, T>

Source§

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