pub enum LoopError {
Source(SourceError),
Sink(SinkError),
Encode(Error),
Listen(BridgeError),
}Expand description
Why the loop stopped.
Variants§
Source(SourceError)
The downstream peer stopped being readable.
A refused envelope is not here. Those are answered and counted in
LoopReport::failed; only the pipe itself failing ends the loop.
Sink(SinkError)
A reply did not reach the downstream peer.
Encode(Error)
An envelope the bridge itself built could not be written as text.
Every value this loop serialises came out of JSON that already parsed,
so it cannot happen — but the signature says it can, and an expect
here would be a panic on the proxy’s own output rather than on a peer’s
bytes, which is the one place a panic is least defensible.
Listen(BridgeError)
The upstream peer’s out-of-band channel could not be opened.
Its own variant because it is the one failure here that says nothing about the downstream pipe: every request already relayed still works, so a caller that wanted a degraded bridge can carry on, and one that did not now has the name of the thing that broke.
Trait Implementations§
Source§impl Error for LoopError
impl Error for LoopError
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()