Trait under::FromFormValue

source ·
pub trait FromFormValue<'f>: Sized {
    type Error;

    fn from_form_value(value: &'f str) -> Result<Self, Self::Error>;
}
Available on crate feature from_form only.
Expand description

A trait for types that can be created from a form.

This is for parsing from a HTML form, not a URL query string. Specifically, this parses from the body of a application/x-www-form-urlencoded request. This takes in the form value specified in the key-value pair provided to FromForm, and returns a Result<Self, Self::Error>. This is similar to FromStr, but allows for different parsings. For example, bool parses from 1, true, on, and yes (with other values defaulting to false).

Required Associated Types§

The error type that can be returned if parsing fails. This is normally encapsulated into a anyhow::Error before being turned into a variant of the FromFormError.

Required Methods§

Converts the given value into a Self.

Implementations on Foreign Types§

Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.
Available on crate feature from_form only.

Implementors§