mirror of https://github.com/rwf2/Rocket.git
parent
4fcb57b704
commit
ae0ccf43f1
|
@ -8,9 +8,7 @@ use crate::http::uri::fmt::{Query, FromUriParam};
|
||||||
/// This type implements the [`FromForm`] trait and thus can be used as a
|
/// This type implements the [`FromForm`] trait and thus can be used as a
|
||||||
/// generic parameter to the [`Form`] data guard: `Form<Lenient<T>>`, where `T`
|
/// generic parameter to the [`Form`] data guard: `Form<Lenient<T>>`, where `T`
|
||||||
/// implements `FromForm`. Unlike using `Form` directly, this type uses a
|
/// implements `FromForm`. Unlike using `Form` directly, this type uses a
|
||||||
/// _lenient_ parsing strategy: forms that contains a superset of the expected
|
/// _lenient_ parsing strategy.
|
||||||
/// fields (i.e, extra fields) will fail to parse and defaults will not be use
|
|
||||||
/// for missing fields.
|
|
||||||
///
|
///
|
||||||
/// # Lenient Parsing
|
/// # Lenient Parsing
|
||||||
///
|
///
|
||||||
|
@ -35,6 +33,8 @@ use crate::http::uri::fmt::{Query, FromUriParam};
|
||||||
///
|
///
|
||||||
/// #[derive(FromForm)]
|
/// #[derive(FromForm)]
|
||||||
/// struct UserInput {
|
/// struct UserInput {
|
||||||
|
/// // Parses as `Some(false)` when `lenient_inner_option` isn't present.
|
||||||
|
/// // Without `Lenient`, this would otherwise parse as `None`.
|
||||||
/// lenient_inner_option: Option<Lenient<bool>>,
|
/// lenient_inner_option: Option<Lenient<bool>>,
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
Loading…
Reference in New Issue