Skip to main content

Event

Enum Event 

Source
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

§message: Box<Message>

The message.

§source: SocketAddr

Which peer sent it.

§transport: TransportKind

Which 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.

§id: u64

Which incarnation delivered it.

§quic_reply: Option<Sender<Bytes>>

Exact QUIC stream to answer on; absent for byte-stream transports and client replies.

§

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: ConnectionKey

Which 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: ConnectionKey

Which connection it arrived on.

§id: u64

Which incarnation received it, so an old queued pong cannot answer a new flow.

§

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: ConnectionKey

Which connection was attempted.

§id: u64

Which incarnation failed.

§kind: ErrorKind

Stable operating-system error category.

§detail: String

Human-readable operating-system detail.

§

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: ConnectionKey

Which secure connection was attempted.

§id: u64

Which incarnation failed.

§detail: String

The TLS backend’s verification detail, containing no key material.

§

QuicClosed

An established QUIC connection closed with a protocol-level reason.

Fields

§key: ConnectionKey

Which secure connection closed.

§id: u64

Which incarnation closed.

§detail: String

QUIC close code and reason.

§

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: ConnectionKey

Which 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.

§id: u64

Which incarnation of the key closed, so a retiring task cannot remove its replacement.

Trait Implementations§

Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,