pub enum NetError {
MalformedUrl(String),
UnsupportedScheme(String),
UnexpectedScheme {
expected: String,
found: String,
},
InvalidPort(String),
InvalidHead(String),
InvalidChunkSize(String),
TruncatedChunk,
InvalidChunkDelimiter,
OversizeBody(usize),
}Expand description
Errors produced by the net-core parsing primitives.
These describe malformed or oversize wire data only. They carry no I/O or application context; callers translate them into their own error domain.
Variants§
MalformedUrl(String)
The URL did not contain a scheme:// separator, or was otherwise
structurally malformed (e.g. missing host).
UnsupportedScheme(String)
The URL scheme is not one this crate recognizes for default-port resolution.
UnexpectedScheme
The URL scheme did not match the scheme a caller required (via
parse_url_for_scheme).
Fields
InvalidPort(String)
The URL port component could not be parsed as a u16.
InvalidHead(String)
The HTTP response head (status line + headers) was malformed.
InvalidChunkSize(String)
A chunked-transfer size line was malformed.
TruncatedChunk
A chunked-transfer body ended before a complete chunk or trailer section.
InvalidChunkDelimiter
A chunked-transfer chunk or trailer section used the wrong delimiter.
OversizeBody(usize)
A length-prefixed or buffered payload exceeded the caller’s size limit.
Trait Implementations§
impl Eq for NetError
Source§impl Error for NetError
impl Error for NetError
1.30.0 · 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()