Skip to main content

ClientEvent

Enum ClientEvent 

Source
#[non_exhaustive]
pub enum ClientEvent { SetupComplete { negotiated_version: u64, }, ControlMessage { direction: Direction, message: AnyControlMessage, raw: Option<Vec<u8>>, }, StreamOpened { direction: Direction, stream_kind: StreamKind, stream_id: u64, }, DataStreamHeader { stream_id: u64, direction: Direction, header: AnySubgroupHeader, }, FetchStreamHeader { stream_id: u64, direction: Direction, header: AnyFetchHeader, }, SubgroupObjectReceived { stream_id: u64, direction: Direction, subgroup_header: SubgroupHeader, object: SubgroupObject, }, FetchHeaderReceived { stream_id: u64, direction: Direction, header: FetchHeader, }, DatagramReceived { direction: Direction, header: AnyDatagramHeader, payload_len: usize, }, StreamClosed { stream_id: u64, error_code: u64, }, Draining { new_session_uri: Vec<u8>, }, Closed { code: u32, reason: Vec<u8>, }, Error { error: String, }, }
Expand description

Events emitted by a MoQT connection.

This enum is #[non_exhaustive] – new variants may be added in minor releases. Downstream match arms should include a wildcard _ => branch.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SetupComplete

MoQT setup handshake completed.

Fields

§negotiated_version: u64

The negotiated MoQT version (from ALPN in draft-17).

§

ControlMessage

A control message was sent or received.

Fields

§direction: Direction

Whether the message was sent or received.

§message: AnyControlMessage

The decoded control message.

§raw: Option<Vec<u8>>

The raw wire bytes of the framed message (type + length + payload). None if raw capture is not available.

§

StreamOpened

A data stream was opened.

Fields

§direction: Direction

Whether we opened (Send) or accepted (Receive) the stream.

§stream_kind: StreamKind

The type of data stream.

§stream_id: u64

Transport-level stream identifier.

§

DataStreamHeader

A data stream header was decoded after the stream opened.

Fields

§stream_id: u64

Transport-level stream identifier.

§direction: Direction

Whether we opened (Send) or accepted (Receive) the stream.

§header: AnySubgroupHeader

The parsed subgroup header.

§

FetchStreamHeader

A fetch response stream header was decoded.

Fields

§stream_id: u64

Transport-level stream identifier.

§direction: Direction

Whether we opened (Send) or accepted (Receive) the stream.

§header: AnyFetchHeader

The parsed fetch header.

§

SubgroupObjectReceived

A subgroup object header was decoded on a subgroup stream.

Fields

§stream_id: u64

Transport-level stream identifier.

§direction: Direction

Direction (Send when emitted from a writer, Receive from a reader).

§subgroup_header: SubgroupHeader

The decoded subgroup header (for context).

§object: SubgroupObject

The decoded subgroup object.

§

FetchHeaderReceived

A fetch header was decoded on a fetch stream.

Fields

§stream_id: u64

Transport-level stream identifier.

§direction: Direction

Direction (Send when emitted from a writer, Receive from a reader).

§header: FetchHeader

The decoded fetch header.

§

DatagramReceived

A datagram was sent or received.

Fields

§direction: Direction

Whether sent or received.

§header: AnyDatagramHeader

The parsed datagram header.

§payload_len: usize

Size of the payload in bytes.

§

StreamClosed

A data stream was closed.

Fields

§stream_id: u64

Transport-level stream identifier.

§error_code: u64

Error code (0 = clean close).

§

Draining

Session entered draining state (GOAWAY received).

Fields

§new_session_uri: Vec<u8>

The new session URI from the GOAWAY message.

§

Closed

Connection was closed.

Fields

§code: u32

Application error code.

§reason: Vec<u8>

Human-readable reason.

§

Error

A transport or protocol error occurred.

Fields

§error: String

Error description.

Trait Implementations§

Source§

impl Clone for ClientEvent

Source§

fn clone(&self) -> ClientEvent

Returns a duplicate of the value. Read more
1.0.0 · 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

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.

§

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> 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 = 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