Enum trillium_http::Error[][src]

#[non_exhaustive]
pub enum Error {
Show 18 variants Io(Error), UnexpectedUriFormat, HeaderMissing(&'static str), RequestPathMissing, Closed, Httparse(Error), TryFromIntError(TryFromIntError), PartialHead, MalformedHeader(Cow<'static, str>), UnsupportedVersion(u8), UnrecognizedMethod(String), MissingMethod, MissingStatusCode, UnrecognizedStatusCode(u16), MissingVersion, EncodingError(Utf8Error), UnexpectedHeader(&'static str), HeadersTooLong,
}
Expand description

Concrete errors that occur within trillium’s http implementation

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io

Tuple Fields of Io

0: Error
UnexpectedUriFormat

this error describes a malformed request with a path that does not start with / or http:// or https://

HeaderMissing

the relevant http protocol expected this header, but it was not provided

Tuple Fields of HeaderMissing

0: &'static str
RequestPathMissing

this error describes a request that does not specify a path

Closed

connection was closed

Httparse

Tuple Fields of Httparse

0: Error
TryFromIntError

Tuple Fields of TryFromIntError

0: TryFromIntError
PartialHead

an incomplete http head

MalformedHeader

we were unable to parse a header

Tuple Fields of MalformedHeader

0: Cow<'static, str>
UnsupportedVersion

async-h1 doesn’t speak this http version this error is deprecated

Tuple Fields of UnsupportedVersion

0: u8
UnrecognizedMethod

we were unable to parse this http method

Tuple Fields of UnrecognizedMethod

0: String
MissingMethod

this request did not have a method

MissingStatusCode

this request did not have a status code

UnrecognizedStatusCode

we were unable to parse this http method

Tuple Fields of UnrecognizedStatusCode

0: u16
MissingVersion

this request did not have a version, but we expect one this error is deprecated

EncodingError

we expected utf8, but there was an encoding error

Tuple Fields of EncodingError

0: Utf8Error
UnexpectedHeader

we received a header that does not make sense in context

Tuple Fields of UnexpectedHeader

0: &'static str
HeadersTooLong

for security reasons, we do not allow request headers beyond 8kb.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.