Skip to main content

ClientEvent

Enum ClientEvent 

Source
pub enum ClientEvent {
    SessionStarted(SessionStarted),
    NoTestCompleted(NoTestCompleted),
    SessionClosed {
        remote: SocketAddr,
        token: u64,
        at: ClientTimestamp,
    },
    EchoSent {
        seq: u32,
        remote: SocketAddr,
        scheduled_at: Option<Instant>,
        sent_at: ClientTimestamp,
        bytes: usize,
        send_call: Duration,
        timer_error: Option<Duration>,
    },
    EchoReply {
        seq: u32,
        remote: SocketAddr,
        sent_at: ClientTimestamp,
        received_at: ClientTimestamp,
        rtt: RttSample,
        server_timing: Option<ServerTiming>,
        one_way: Option<OneWayDelaySample>,
        received_stats: Option<ReceivedStatsSample>,
        bytes: usize,
        packet_meta: PacketMeta,
    },
    EchoLoss {
        seq: u32,
        sent_at: ClientTimestamp,
        timeout_at: Instant,
    },
    DuplicateReply {
        seq: u32,
        remote: SocketAddr,
        received_at: ClientTimestamp,
        bytes: usize,
    },
    LateReply {
        seq: u32,
        highest_seen: u32,
        remote: SocketAddr,
        sent_at: Option<ClientTimestamp>,
        received_at: ClientTimestamp,
        rtt: Option<RttSample>,
        server_timing: Option<ServerTiming>,
        one_way: Option<OneWayDelaySample>,
        received_stats: Option<ReceivedStatsSample>,
        bytes: usize,
        packet_meta: PacketMeta,
    },
    Warning {
        kind: WarningKind,
        message: String,
        at: ClientTimestamp,
    },
}
Expand description

Event emitted by an IRTT client session.

Events form the public lifecycle and measurement stream for callers. UIs usually display lifecycle, warning, and per-packet events directly; summary reporting should aggregate EchoSent, EchoReply, EchoLoss, LateReply, and DuplicateReply events or pass the stream to irtt-stats.

Variants§

§

SessionStarted(SessionStarted)

A normal session has opened and is ready to send echo probes.

§

NoTestCompleted(NoTestCompleted)

A no-test exchange completed without creating a live session.

No EchoSent, EchoReply, EchoLoss, or SessionClosed events are expected for this outcome.

§

SessionClosed

The session closed locally or through an authenticated peer close.

For a peer close-flagged echo reply, the reply’s measurement or classification event is emitted immediately before this event. Managed sessions disconnect event subscribers after the worker exits, while leaving already queued events available to drain.

Fields

§remote: SocketAddr

Resolved remote socket address.

§token: u64

Session token that was closed.

§at: ClientTimestamp

Client timestamp when the close request was sent.

§

EchoSent

An echo request was sent.

This records local scheduling and send-call timing. It does not imply a reply will arrive; callers should pair it with EchoReply, EchoLoss, LateReply, or DuplicateReply by sequence number when displaying packet lifecycle state.

Fields

§seq: u32

Wire sequence number sent in the echo request.

§remote: SocketAddr

Resolved remote socket address.

§scheduled_at: Option<Instant>

Intended send deadline, supplied by the managed runner. Low-level adapters leave this absent.

§sent_at: ClientTimestamp

Paired client wall/monotonic timestamp captured immediately after the successful UDP send completed. This is the RTT and userspace upstream one-way-delay fallback endpoint. The operational probe timeout deadline is computed from an earlier, private, pre-send timestamp instead — see the client crate’s AGENTS.md.

§bytes: usize

Number of bytes passed to the UDP socket.

§send_call: Duration

Elapsed time spent in the socket send call, excluding protocol and scheduler commit work.

§timer_error: Option<Duration>

Absolute difference between the scheduled send time and the post-send sent_at timestamp above; absent for low-level sends.

§

EchoReply

First in-window reply for a pending echo request.

This is the primary successful measurement event. RTT and optional server timing/statistics fields should generally be aggregated from this variant.

Fields

§seq: u32

Wire sequence number from the echo reply.

§remote: SocketAddr

Resolved remote socket address.

§sent_at: ClientTimestamp

Client timestamp recorded immediately after the matching request finished sending (see ClientEvent::EchoSent::sent_at).

§received_at: ClientTimestamp

Client timestamp recorded when the reply was received.

§rtt: RttSample

Round-trip timing sample for this reply.

§server_timing: Option<ServerTiming>

Optional server-reported timestamps and processing time.

§one_way: Option<OneWayDelaySample>

Optional one-way delay values derived from client/server wall clocks.

§received_stats: Option<ReceivedStatsSample>

Optional server-reported received-statistics sample.

§bytes: usize

UDP datagram size received from the socket.

§packet_meta: PacketMeta

Receive-side metadata observed outside the IRTT wire payload.

§

EchoLoss

A sent echo request exceeded the local probe timeout before a reply was matched.

A later datagram for the same sequence may still arrive and will be reported as ClientEvent::LateReply rather than changing this event.

Fields

§seq: u32

Wire sequence number that timed out.

§sent_at: ClientTimestamp

Client timestamp recorded immediately after the request finished sending (see ClientEvent::EchoSent::sent_at). The timeout deadline below is anchored to an earlier, private, pre-send timestamp, not to this one.

§timeout_at: Instant

Monotonic deadline at which the probe was declared lost.

§

DuplicateReply

Additional reply for a sequence that was already completed.

Duplicates are not primary RTT samples. They are useful for diagnostics and packet counters, but should not be aggregated as successful first replies.

Fields

§seq: u32

Wire sequence number from the duplicate reply.

§remote: SocketAddr

Resolved remote socket address.

§received_at: ClientTimestamp

Client timestamp recorded when the duplicate was received.

§bytes: usize

UDP datagram size received from the socket.

§

LateReply

Reply for a sequence that was no longer pending.

This commonly means the probe had already been reported as lost, or the reply arrived out of the client’s current tracking window. When the original send metadata is still retained, RTT and one-way timing are included; otherwise those fields are None.

Fields

§seq: u32

Wire sequence number from the late reply.

§highest_seen: u32

Highest sequence number accepted as an in-window first reply so far.

§remote: SocketAddr

Resolved remote socket address.

§sent_at: Option<ClientTimestamp>

Original post-send client timestamp, when still retained (see ClientEvent::EchoSent::sent_at).

§received_at: ClientTimestamp

Client timestamp recorded when the late reply was received.

§rtt: Option<RttSample>

RTT sample computed when the original send timestamp is available.

§server_timing: Option<ServerTiming>

Optional server-reported timestamps and processing time.

§one_way: Option<OneWayDelaySample>

Optional one-way delay values derived from client/server wall clocks.

§received_stats: Option<ReceivedStatsSample>

Optional server-reported received-statistics sample.

§bytes: usize

UDP datagram size received from the socket.

§packet_meta: PacketMeta

Receive-side metadata observed outside the IRTT wire payload.

§

Warning

Non-fatal condition observed while receiving or classifying packets.

Warning events are diagnostic. They do not close the session by themselves and are not measurement samples.

Fields

§kind: WarningKind

Machine-readable warning category.

§message: String

Human-readable diagnostic text.

§at: ClientTimestamp

Client timestamp when the warning was emitted.

Trait Implementations§

Source§

impl Clone for ClientEvent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientEvent

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for ClientEvent

Source§

impl From<SendReceipt> for ClientEvent

Source§

fn from(receipt: SendReceipt) -> Self

Construct the committed send event without scheduling annotations.

Source§

impl PartialEq for ClientEvent

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ClientEvent

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.