Enum gotham_formdata::Error
source · #[non_exhaustive]
pub enum Error {
Show 13 variants
IllegalBody(Error),
IllegalContentType(FromStrError),
IllegalContentTypeValue(ToStrError),
IllegalField(String, Error),
InvalidData(ValidationErrors),
IoError(Error),
MissingBoundary,
MissingContentType,
MissingContentDisposition,
MissingField(String),
MultipartError(Error),
UnknownContentType(Mime),
UnknownField(String),
}
Expand description
This error type is used when parsing form data from a request body was unsuccessful.
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.
IllegalBody(Error)
The body of the request could not be read.
IllegalContentType(FromStrError)
The content type of the body was not a valid mime type.
IllegalContentTypeValue(ToStrError)
The content type of the body contained unreadable bytes.
IllegalField(String, Error)
The value of a field could not be parsed into that field’s type.
InvalidData(ValidationErrors)
The body was parsed but contained data that did not pass validation.
IoError(Error)
An I/O error occured while reading the body.
MissingBoundary
The body was a multipart body but did not specify a boundary.
MissingContentType
The request did not specify a content type.
MissingContentDisposition
One of the multipart parts is missing a Content-Disposition
header.
MissingField(String)
The body is missing a required field.
MultipartError(Error)
The multipart format was invalid.
UnknownContentType(Mime)
The body’s content type is not supported.
UnknownField(String)
The body contained a field that was not expected.
Trait Implementations§
source§impl Error for Error
impl Error for Error
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
source§impl From<FromStrError> for Error
impl From<FromStrError> for Error
source§fn from(source: FromStrError) -> Self
fn from(source: FromStrError) -> Self
Converts to this type from the input type.
source§impl From<ToStrError> for Error
impl From<ToStrError> for Error
source§fn from(source: ToStrError) -> Self
fn from(source: ToStrError) -> Self
Converts to this type from the input type.
source§impl From<ValidationErrors> for Error
impl From<ValidationErrors> for Error
source§fn from(source: ValidationErrors) -> Self
fn from(source: ValidationErrors) -> Self
Converts to this type from the input type.