#[non_exhaustive]pub enum Error {
Show 21 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),
ExtendedConnectUnsupported,
}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
ExtendedConnectUnsupported
HTTP/2 peer has not advertised SETTINGS_ENABLE_CONNECT_PROTOCOL = 1 (RFC 8441 §3),
so an extended-CONNECT (e.g. WebSocket-over-h2) request cannot be sent on this
connection. Surfaced by the client when it has waited for the peer’s first SETTINGS
frame and confirmed the capability is unavailable, so the spec-violating
:protocol HEADERS is never put on the wire.
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()