pub enum Error {
CannotExpressAsUtf8(FromUtf8Error),
EmptyScheme,
IllegalCharacter(Context),
IllegalPercentEncoding,
IllegalPortNumber(ParseIntError),
InvalidDecimalOctet,
TooFewAddressParts,
TooManyAddressParts,
TooManyDigits,
TooManyDoubleColons,
TruncatedHost,
}Expand description
This is the enumeration of all the different kinds of errors which this crate generates.
Variants§
CannotExpressAsUtf8(FromUtf8Error)
One or more components of the URI contains a non-UTF8 sequence, and so cannot be converted to a Rust string.
EmptyScheme
URI begins with an empty scheme, such as ://www.example.com
IllegalCharacter(Context)
URI contains a character which is not permitted in the context where it
was encountered; for example, a caret (^) in a query:
http://www.example.com?eat_my_^
IllegalPercentEncoding
URI contains an incorrect percent encoding, such as
http://www.example.com?foo=%GG
IllegalPortNumber(ParseIntError)
URI contains an invalid port number, such as
http://www.example.com:99999 or http://www.example.com:foo
InvalidDecimalOctet
URI contains an IPv4 address with one or more bad parts, such as
http://[::ffff:1.2.3.256]/
TooFewAddressParts
URI contains an IP address with missing parts, such as
http://[::ffff:1.2.3]/
TooManyAddressParts
URI contains an IP address with too many parts, such as
http://[::ffff:1.2.3.4.8]/
TooManyDigits
URI contains an IPv6 address with too many digits, such as
http://[20001:db8:85a3::1]/
TooManyDoubleColons
URI contains an IPv6 address with more than one double-colon, such as
http://[2001:db8:85a3::8a2e::]/
TruncatedHost
URI contains an IPv6 address that is truncated, such as
http://[2001:db8:85a3::8a2e:0:]/