#[non_exhaustive]pub enum ClientEvent {
Show 13 variants
SetupComplete {
negotiated_version: u64,
},
ControlMessage {
direction: Direction,
message: AnyControlMessage,
stream_id: Option<u64>,
raw: Option<Vec<u8>>,
},
StreamOpened {
direction: Direction,
stream_kind: StreamKind,
stream_id: u64,
},
DataStreamHeader {
stream_id: u64,
direction: Direction,
header: AnySubgroupHeader,
},
PublishStateNotify {
request_id: u64,
stream_id: u64,
parameters: Vec<KeyValuePair>,
},
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
SetupComplete
MoQT setup handshake completed.
ControlMessage
A control message was sent or received.
Fields
message: AnyControlMessageThe decoded control message.
stream_id: Option<u64>The transport-level identifier of the stream the message travelled
on when that stream is a request stream, and None when it is the
control stream.
Draft-20 responses carry no request id: the stream is the correlation. Without this an observer sees a SUBSCRIBE_OK with nothing to say which SUBSCRIBE it answers, and cannot tell a message on the control stream from one on a request stream.
StreamOpened
A data stream was opened.
Fields
stream_kind: StreamKindThe type of data stream.
DataStreamHeader
A data stream header was decoded after the stream opened.
Fields
header: AnySubgroupHeaderThe parsed subgroup header.
PublishStateNotify
The publisher reported that a subscription’s state changed, other than in answer to a REQUEST_UPDATE this endpoint sent.
PUBLISH_STATE_NOTIFY, new in draft-20 (Section 10.10). Nothing is owed in reply — “it is a unilateral notification: the receiver does not respond with REQUEST_OK or REQUEST_ERROR, and the message is not subject to the MAX_REQUEST_UPDATES limit” — and “no action is required by the recipient”. It is an event rather than a return value for that reason: there is nothing for a caller to do with it except notice.
It also arrives as an ordinary ClientEvent::ControlMessage, as every
message does. This variant is the decoded form, so an observer does not
have to reach through AnyControlMessage to find out which subscription
changed.
Fields
request_id: u64The Request ID of the subscription whose state changed.
The message itself carries no Request ID field: Section 10.10 makes the bidirectional stream the correlation, exactly as it is for SUBSCRIBE_OK, PUBLISH_DONE and FETCH_OK. This is the request that stream belongs to.
parameters: Vec<KeyValuePair>The parameters whose values changed. A parameter that is absent is unchanged; the publisher “MUST include the LARGEST_OBJECT parameter” if known, so a receiver can place the change in the track.
FetchStreamHeader
A fetch response stream header was decoded.
Fields
header: AnyFetchHeaderThe parsed fetch header.
SubgroupObjectReceived
A subgroup object header was decoded on a subgroup stream.
Fields
subgroup_header: SubgroupHeaderThe decoded subgroup header (for context).
object: SubgroupObjectThe decoded subgroup object.
FetchHeaderReceived
A fetch header was decoded on a fetch stream.
Fields
header: FetchHeaderThe decoded fetch header.
DatagramReceived
A datagram was sent or received.
Fields
header: AnyDatagramHeaderThe parsed datagram header.
StreamClosed
A data stream was closed.
Fields
Draining
Session entered draining state (GOAWAY received).
Closed
Connection was closed.
Error
A transport or protocol error occurred.
Trait Implementations§
Source§impl Clone for ClientEvent
impl Clone for ClientEvent
Source§fn clone(&self) -> ClientEvent
fn clone(&self) -> ClientEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more