#[non_exhaustive]pub enum ParseError {
StartLine(StartLineError),
HeaderSyntax {
line: usize,
kind: HeaderSyntaxError,
},
Framing(FramingError),
Limit {
limit: LimitKind,
value: usize,
},
Incomplete,
}Expand description
A message that could not be framed or whose structure is malformed.
Structural only: a message whose headers are bad still parses (see HeaderError).
The transaction layer maps these onto a response status, which is why each variant says
what went wrong rather than merely that something did.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
StartLine(StartLineError)
The request or status line is malformed. Answer 400.
HeaderSyntax
A header field line is malformed. Answer 400.
Fields
kind: HeaderSyntaxErrorWhat was wrong with it.
Framing(FramingError)
The message body cannot be delimited. Answer 400; on a stream transport the framing is unrecoverable and the connection must be closed.
Limit
A configured limit was exceeded. Answer 413 for body limits.
Incomplete
Not enough bytes yet. Only ever returned internally by the stream parser; callers see it as “no message completed”.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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()
Source§impl From<FramingError> for ParseError
impl From<FramingError> for ParseError
Source§fn from(source: FramingError) -> Self
fn from(source: FramingError) -> Self
Source§impl From<StartLineError> for ParseError
impl From<StartLineError> for ParseError
Source§fn from(source: StartLineError) -> Self
fn from(source: StartLineError) -> Self
Source§impl PartialEq for ParseError
impl PartialEq for ParseError
Source§fn eq(&self, other: &ParseError) -> bool
fn eq(&self, other: &ParseError) -> bool
self and other values to be equal, and is used by ==.