pub enum LossCause {
IdleTimeout,
PeerClosed,
LocallyClosed,
Reset,
TransportError,
}Expand description
Why a connection is gone.
The outcome is the same whichever it is — nothing that was in flight
completed, which is what Error::ConnectionLost promises — so this is
not a second outcome vocabulary. It exists because the next action differs:
an idle timeout invites a redial, a peer that closed deliberately may not
want one yet, and a local close means the application already decided.
Variants§
IdleTimeout
No traffic for the idle period, on whichever side’s timeout was shorter. Nothing is wrong with either peer.
PeerClosed
The peer closed the connection deliberately, with a code this side does not map to a more specific outcome — a shutdown, typically.
LocallyClosed
This side closed it: Runtime::shutdown, or a dropped runtime.
Reset
A stateless reset: the peer has forgotten the connection, usually because it restarted.
TransportError
A QUIC transport error ended the connection. Either peer may be at fault, and a redial is unlikely to behave differently.