#[non_exhaustive]pub enum FromFormError {
MissingField(&'static str),
InvalidFormat(&'static str, &'static str, Error),
}
Available on crate feature
from_form
only.Expand description
The error type for parsing a form.
This is returned by FromForm::from_form
. You should not need to
implement these yourself.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MissingField(&'static str)
A field was missing from the form. This is returned when a field is missing from the form, but is required. This includes only the expected field’s primary name - i.e., none of its aliases. However, if the field is renamed, the value will be the renamed value.
InvalidFormat(&'static str, &'static str, Error)
A field could not be parsed. This is returned when a field could not be parsed into the expected type. This includes the expected field’s primary name - i.e., none of its aliases (however, if the field is renamed, the value will be the renamed value). The second value is the type that was expected. The third value is the error returned by the parser.
Trait Implementations§
Source§impl Debug for FromFormError
impl Debug for FromFormError
Source§impl Display for FromFormError
impl Display for FromFormError
Source§impl Error for FromFormError
impl Error for FromFormError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for FromFormError
impl RefUnwindSafe for FromFormError
impl Send for FromFormError
impl Sync for FromFormError
impl Unpin for FromFormError
impl UnwindSafe for FromFormError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more