#[non_exhaustive]pub enum Error {
Show 20 variants
Io(Error),
UnexpectedUriFormat,
HeaderMissing(HeaderName<'static>),
RequestPathMissing,
Closed,
TryFromIntError(TryFromIntError),
InvalidHead,
InvalidHeaderName,
InvalidHeaderValue(HeaderName<'static>),
UnsupportedVersion(Version),
InvalidVersion,
UnrecognizedMethod(String),
MissingMethod,
MissingStatus,
InvalidStatus,
EncodingError(Utf8Error),
UnexpectedHeader(HeaderName<'static>),
HeadersTooLong,
ReceivedBodyTooLong(u64),
TimedOut(&'static str, Duration),
}Expand description
Concrete errors that occur within trillium’s HTTP implementation
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
UnexpectedUriFormat
this error describes a malformed request with a path that does not start with / or http:// or https://
HeaderMissing(HeaderName<'static>)
the relevant HTTP protocol expected this header, but it was not provided
RequestPathMissing
this error describes a request that does not specify a path
Closed
connection was closed
TryFromIntError(TryFromIntError)
InvalidHead
An incomplete or invalid HTTP head
InvalidHeaderName
We were unable to parse a HeaderName
InvalidHeaderValue(HeaderName<'static>)
We were unable to parse a HeaderValue
UnsupportedVersion(Version)
we were able to parse this Version, but we do not support it
InvalidVersion
We were unable to parse a Version
UnrecognizedMethod(String)
we were unable to parse this method
MissingMethod
this request did not have a method
MissingStatus
this request did not have a status code
InvalidStatus
we were unable to parse a Status
EncodingError(Utf8Error)
we expected utf8, but there was an encoding error
UnexpectedHeader(HeaderName<'static>)
we either received a header that does not make sense in context
HeadersTooLong
to mitigate against malicious HTTP clients, we do not allow request headers beyond this length.
ReceivedBodyTooLong(u64)
to mitigate against malicious HTTP clients, we do not read received bodies beyond this
length to memory. If you need to receive longer bodies, use the Stream or AsyncRead
implementation on ReceivedBody
TimedOut(&'static str, Duration)
something took longer than was allowed
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()