pub enum Error {
Show 38 variants
InvalidMethod,
InvalidTarget,
InvalidVersion,
VersionNotSupported,
RequestLineTooLong,
HeadTooLarge,
TooManyHeaders,
HeaderLineTooLong,
InvalidHeaderName,
InvalidHeaderValue,
WhitespaceBeforeColon,
ObsFold,
BareCr,
BareLf,
MissingHost,
DuplicateHost,
InvalidHost,
TeWithContentLength,
DuplicateContentLength,
InvalidContentLength,
InvalidTransferEncoding,
ChunkedNotFinal,
UnsupportedTransferCoding,
TransferEncodingHttp10,
BodyTooLarge,
ExpectationFailed,
DuplicateUpgrade,
InvalidChunkSize,
ChunkSizeOverflow,
InvalidChunkExtension,
ChunkLineTooLong,
MissingChunkCrlf,
TrailersTooLarge,
ForbiddenTrailer,
UnexpectedEof,
InvalidStatus,
InvalidReason,
FramingHeader,
}Expand description
Why a message was refused. Every error means the connection must close after the error response (if any) is sent.
Variants§
InvalidMethod
The method is empty or has a byte outside tchar, or is not followed by one SP.
InvalidTarget
The request target has a forbidden byte, bad percent-encoding, or the wrong form for the method.
InvalidVersion
The version is not HTTP/ digit . digit, or the start line has extra bytes.
VersionNotSupported
A well-formed version other than 1.0 and 1.1.
RequestLineTooLong
The request line passed Limits::max_request_line.
HeadTooLarge
The head passed Limits::max_head.
TooManyHeaders
More than Limits::max_headers fields, or more than the header storage holds.
HeaderLineTooLong
A header line passed Limits::max_header_line.
InvalidHeaderName
A field name is empty or has a byte outside tchar.
InvalidHeaderValue
A field value has a control byte other than HTAB.
WhitespaceBeforeColon
Whitespace between a field name and the colon (RFC 9112 §5.1).
ObsFold
A line starting with whitespace: obs-fold, or whitespace after the start line.
BareCr
CR not followed by LF.
BareLf
LF not preceded by CR.
MissingHost
An HTTP/1.1 request without Host.
DuplicateHost
More than one Host.
InvalidHost
A Host value that is not uri-host [":" port].
TeWithContentLength
Both Transfer-Encoding and Content-Length.
DuplicateContentLength
More than one Content-Length value, equal or not.
InvalidContentLength
A Content-Length that is not 1*DIGIT within 64 bits.
InvalidTransferEncoding
A malformed Transfer-Encoding list (empty elements, non-token codings, parameters).
ChunkedNotFinal
Transfer-Encoding whose final coding is not chunked, or chunked twice.
UnsupportedTransferCoding
Codings before the final chunked (they are not implemented).
TransferEncodingHttp10
Transfer-Encoding in an HTTP/1.0 request.
BodyTooLarge
The body passed Limits::max_body.
ExpectationFailed
An Expect value other than 100-continue.
DuplicateUpgrade
A duplicate Upgrade field.
InvalidChunkSize
A chunk size that is not 1*HEXDIG.
ChunkSizeOverflow
A chunk size beyond 64 bits.
InvalidChunkExtension
A chunk extension that breaks the RFC 9112 §7.1.1 grammar.
ChunkLineTooLong
A chunk-size line longer than Limits::max_chunk_line.
MissingChunkCrlf
Chunk data not followed by CRLF.
TrailersTooLarge
The trailer section passed Limits::max_trailers.
ForbiddenTrailer
A trailer field that may not be a trailer (Content-Length, Transfer-Encoding,
Host).
UnexpectedEof
The connection closed inside a body.
InvalidStatus
A status code that is not three digits from 100 to 599.
InvalidReason
A reason phrase with a control byte.
FramingHeader
A writer was asked to emit Content-Length or Transfer-Encoding as a plain field;
use the framing methods instead.
Implementations§
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()