Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

Unified multi-draft entry-point types.

This module is the facade downstream consumers use to hold a MoQT connection without caring which draft was negotiated. It mirrors moqtap_codec::dispatch: one enum variant per enabled draft, gated on its feature flag.

Four types live here:

  • AnyConnection — wraps a draft-specific Connection.
  • AnyClientEvent — wraps a draft-specific ClientEvent.
  • AnyConnectionObserver — a trait that receives AnyClientEvents. Attached to an AnyConnection via AnyConnection::set_observer, which installs a per-draft adapter on the inner connection.
  • AnyRequest — what a request made through AnyConnection leaves the caller holding. Drafts 07-16 put every request on the one control stream and hand back only a request ID; from draft-17 on each request owns a bidirectional stream, and the handle owns that stream.

AnyConnection carries only the handful of protocol methods whose arguments can be reconciled across every draft that has the message (subscribe, fetch, track_status, subscribe_namespace, publish_namespace, publish, subscribe_tracks). The rest differ too much in signature — match on the variant to reach them.

Re-exports§

use std::sync::Arc; 🔒
use moqtap_codec::kvp::KeyValuePair; 🔒
use moqtap_codec::version::DraftVersion; 🔒

Modules§

Draft07 🔒
Draft08 🔒
Draft09 🔒
Draft10 🔒
Draft11 🔒
Draft12 🔒
Draft13 🔒
Draft14 🔒
Draft15 🔒
Draft16 🔒
Draft17 🔒
Draft18 🔒
Draft19 🔒
Draft20 🔒
Draft21 🔒
Draft22 🔒
Draft23 🔒

Macros§

data_stream_dispatch 🔒
Expands one body per group of drafts that share a shape, over AnySubgroupWriter, AnySubgroupReader or AnyFetchReader.
dispatch_all 🔒
Generates the AnyConnection and AnyClientEvent enums plus the per-draft observer adapter, with one variant per enabled draft feature.

Structs§

AnyClientConfig
Draft-agnostic client configuration. The exact per-draft ClientConfig is constructed internally by AnyConnection::connect based on draft.
AnyConnectionError
Error returned by AnyConnection::connect, AnyConnection::recv_response and the rest of this facade.
AnyFetchObject
One object on a fetch stream, in the terms every draft shares.
AnyObject
One object on a subgroup stream, in the terms every draft shares.
ControlFrame
One control message as it crossed the wire, lifted out of whichever draft’s event carried it.
Draft16FetchStream
Draft-16’s fetch stream, carried with the resolver its objects need.
FetchRange
The range one AnyConnection::fetch asks for.
NoOpObserver
A no-op observer that discards all events.
SubscribeRange
The range one AnyConnection::subscribe_range asks for.

Enums§

AnyArrival
What arrived from the peer, and whether this facade has a handle for it.
AnyClientEvent
An event from a MoQT connection of any enabled draft version.
AnyConnection
A MoQT client connection of any enabled draft version.
AnyFetchReader
A fetch stream the peer opened, that this endpoint is reading.
AnyInboundRequest
A request the peer made, and the handle this side answers it through.
AnyRequest
A request made through AnyConnection, in whichever form the negotiated draft carries it.
AnySubgroupReader
A subgroup stream the peer opened, that this endpoint is reading.
AnySubgroupWriter
A subgroup stream this endpoint opened and is writing objects to.
AnyTransportType
Draft-agnostic transport choice for AnyConnection::connect.
ErrorCause
Why a call through this facade stopped, kept as a value rather than as words.
FetchEnd
Where a FETCH’s range ends, said once in a way no draft can read two ways.
JoiningStart
Where a Joining FETCH starts, said once for the two forms the drafts give it.
SubscribeEnd
Where a subscription’s range stops, said once in a way no draft can read two ways.

Traits§

AnyConnectionObserver
Trait for receiving events from an AnyConnection.

Functions§

fetch_group_order
The Group Order a FETCH_OK named, for handing to AnyConnection::accept_fetch.
forward_parameter 🔒
forward as the FORWARD parameter, key 0x10, which is where drafts 15 through 22 carry the field drafts 12 through 14 write inline in a PUBLISH. The codec owns the value’s encoding on each draft, so this hands it over as a plain varint.