#[non_exhaustive]pub enum ErrorKind {
Resolve,
Connect,
Tls,
Redirect,
Timeout(Phase),
Body,
Decode,
Status,
Unsupported,
Cancelled,
Other,
}Expand description
The error’s category. Exists so the consumer doesn’t have to classify
errors by substring-matching on Display.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Resolve
Connect
Tls
Redirect
Timeout(Phase)
Body
Decode
Status
Unsupported
Cancelled
The capability behind the failed operation was pulled out from under
it before it could finish — typically, the runtime is shutting down
while the task was still queued (see hclient_rt::Cancelled,
returned by Blocking::run, amendment-C5).
A separate variant, not Other: Other is the honest answer for a
GENUINELY opaque backend error (the default Transport::to_error,
when the backend has nothing to say about the category). Cancellation
is the opposite of opacity: it’s a condition known in advance and
already typed (Cancelled is not a string or an OS error code, but a
concrete type), one that EVERY future consumer of the Blocking
capability will hit, not a one-off for a single backend. It must not
be mixed with Other, and even less with the category of the failed
operation itself (e.g. Resolve for a DNS resolver built on
Blocking, see hclient-dns-system) — for the same reason Resolve
and Other aren’t mixed with each other: the caller must be able to
tell “this attempt failed on its merits” from “this attempt didn’t
finish because the runtime is shutting down” without a downcast —
just by comparing kind().