pub enum Event {
Message {
message: Box<Message>,
source: SocketAddr,
transport: TransportKind,
id: u64,
quic_reply: Option<Sender<Bytes>>,
},
FramingFailed {
key: ConnectionKey,
},
Pong {
key: ConnectionKey,
id: u64,
},
ConnectFailed {
key: ConnectionKey,
id: u64,
kind: ErrorKind,
detail: String,
},
HandshakeFailed {
key: ConnectionKey,
id: u64,
detail: String,
},
QuicClosed {
key: ConnectionKey,
id: u64,
detail: String,
},
Closed {
key: ConnectionKey,
id: u64,
},
}Expand description
Something that happened on a connection.
Variants§
Message
A complete message arrived.
Fields
source: SocketAddrWhich peer sent it.
transport: TransportKindWhich transport carried it. A TLS connection and a TCP one are both streams and share every line of framing below; only this distinguishes them, and a message that arrived over TLS must not be reported as cleartext.
FramingFailed
Framing was lost, so the connection is being closed and everything in flight with it.
Reported rather than only logged because it is the stream half of a parse failure, and §12 counts those per transport: “a malformed datagram and a stream whose framing is lost are the same failure on different transports”. The connection task has no counter in scope — it is spawned before the driver — so it says what happened and the driver counts it, which is also how every other counter in this crate stays at one increment site.
A Closed follows. This does not replace it: what is lost and what is closed are two facts,
and an operator needs the first to explain the second.
Fields
key: ConnectionKeyWhich connection lost framing.
Pong
A CRLF keep-alive arrived on this connection (RFC 5626 §4.4.1).
Reported rather than dropped because it is the pong half of the mechanism: a UA that sent a CRLFCRLF ping “MUST treat the flow as failed” if no single-CRLF pong comes back within 10 seconds, which it cannot do if nothing tells it one arrived.
Fields
key: ConnectionKeyWhich connection it arrived on.
ConnectFailed
An outbound socket could not be opened.
Closed follows, but cannot distinguish a failed dial from a connection that became
usable and later disappeared. The driver needs that distinction to count a queued request
as unsent without overstating loss for bytes that may already have reached the peer.
Fields
key: ConnectionKeyWhich connection was attempted.
HandshakeFailed
TLS authentication failed before the connection became usable.
Separate from Closed so a caller can distinguish a rejected certificate from an
established connection that later disappeared. Closed still follows and releases the
pool slot.
Fields
key: ConnectionKeyWhich secure connection was attempted.
QuicClosed
An established QUIC connection closed with a protocol-level reason.
Fields
key: ConnectionKeyWhich secure connection closed.
Closed
The connection is gone.
Every transaction bound to it is given a transport error rather than being left to time out: waiting 32 seconds to learn something we already know is both a bad experience and a resource leak.
Fields
key: ConnectionKeyWhich connection closed. The whole key, not just the peer: two connections to one address are ordinary now, and removing the wrong one is worse than removing none.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more