pub(crate) enum EgressError {
Transport(TransportError),
}Expand description
What writing to a destination can fail with.
Deliberately narrower than ProxyError: this module hands bytes to a
transport and abandons streams, and those are the only two ways it can
fail. Naming them separately is what lets a sink be implemented without
naming a crate-wide error enum whose listener, TLS, certificate, qlog and
draft-admission cases a write can never produce — and the recording sink
below is the second implementor, so “without naming it” is not
hypothetical.
Nothing a caller sees changes: the conversion below is applied by ? at
every boundary this module is called across, and it produces the same
ProxyError the failure produced before.
One case, and the enum is still the right shape. Every failure reaching here today comes back from the transport, which is a fact about the two operations rather than about the one production implementor — so a second case would be a second kind of failure, not a second sink, and would want a name of its own. The recording sink below models a refused write as a refused write for the same reason: a test sink inventing a failure the transport cannot produce would be testing a path nothing takes.
Variants§
Transport(TransportError)
The transport refused a write or a reset.
Trait Implementations§
Source§impl Debug for EgressError
impl Debug for EgressError
Source§impl Display for EgressError
impl Display for EgressError
Source§impl Error for EgressError
impl Error for EgressError
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()