#[non_exhaustive]pub enum ContentErrorKind {
Show 23 variants
MissingMediaType,
UnsupportedMediaType,
UnacceptedFormat,
UnsupportedCharset,
BodySizeLimit,
PreambleSizeLimit,
EpilogueSizeLimit,
HeaderSizeLimit,
HeaderCountLimit,
PartCountLimit,
PairCountLimit,
DepthLimit,
CountLimit,
FieldSizeLimit,
ContentSizeLimit,
UnknownName,
InvalidBoundary,
MissingName,
InvalidPartHeader,
EmptyFilenameContent,
UnexpectedEnd,
MalformedMultipart,
MalformedUrlEncoded,
}Expand description
The kind of ContentError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingMediaType
The request has no media type. 415 Unsupported Media Type.
UnsupportedMediaType
The request’s media type is not a format this crate parses. 415 Unsupported Media Type.
UnacceptedFormat
The declaration does not accept the request’s format. 415 Unsupported Media Type.
UnsupportedCharset
An application/x-www-form-urlencoded media type declares a charset other than UTF-8 or US-ASCII. 415 Unsupported Media Type.
BodySizeLimit
The body is longer than the largest the declaration could need, Content::body_size_limit. 413 Content Too Large.
PreambleSizeLimit
The bytes before a multipart/form-data body’s first boundary exceed the preamble limit. 413 Content Too Large.
EpilogueSizeLimit
The bytes after a multipart/form-data body’s closing boundary line exceed the epilogue limit. 413 Content Too Large.
HeaderSizeLimit
A part’s header section, with any padding after its boundary, exceeds the header section limit. 413 Content Too Large.
HeaderCountLimit
A part’s header section has more fields than the header count limit. 413 Content Too Large.
PartCountLimit
The body has more parts than the part count limit. 413 Content Too Large.
PairCountLimit
An application/x-www-form-urlencoded body has more pairs than the pair count limit. 413 Content Too Large.
DepthLimit
A name has more components than the depth limit. 413 Content Too Large.
CountLimit
An array has more elements than its count limit. 413 Content Too Large.
FieldSizeLimit
A field or upload has more content than its size limit. 413 Content Too Large.
ContentSizeLimit
The fields and uploads together have more content than the total content limit. 413 Content Too Large.
UnknownName
A name is not one the declaration accepts, including a name that is not base, base[key], or base[], repeated. 400 Bad Request.
InvalidBoundary
A multipart/form-data media type has no boundary parameter, or one RFC 2046 does not allow. 400 Bad Request.
MissingName
A part’s Content-Disposition is missing, is not form-data, or has no name. 400 Bad Request.
InvalidPartHeader
A part’s header fields cannot be read: a header line is malformed or folded, a Content-Disposition or Content-Type is invalid or repeated, its parameters break the ParameterRules, or its Content-Transfer-Encoding is not an identity encoding. 400 Bad Request.
EmptyFilenameContent
A part for a declared upload has an empty filename, which browsers send for a file input with no file chosen, yet has content. 400 Bad Request.
UnexpectedEnd
The content ended before it was complete: a multipart body before its closing boundary, or URL-encoded content whose end was not given to ContentParser::parse_end. 400 Bad Request.
MalformedMultipart
The multipart framing is malformed, as base-web-multipart reports it, such as a boundary line that does not end with a line break, or a boundary after a bare CR or LF. 400 Bad Request.
MalformedUrlEncoded
URL-encoded content is malformed, as base-web-url reports it: a % not followed by two hexadecimal digits, or decoded text that is not UTF-8. 400 Bad Request.