pub enum AnyConnection {
Draft07(Connection),
Draft08(Connection),
Draft09(Connection),
Draft10(Connection),
Draft11(Connection),
Draft12(Connection),
Draft13(Connection),
Draft14(Connection),
Draft15(Connection),
Draft16(Connection),
Draft17(Connection),
Draft18(Connection),
}Expand description
A MoQT client connection of any enabled draft version.
Wraps the draft-specific Connection type. Methods common to all
drafts are forwarded; for draft-specific protocol calls, match on
the variant.
Variants§
Draft07(Connection)
A draft-draft07 connection.
Draft08(Connection)
A draft-draft08 connection.
Draft09(Connection)
A draft-draft09 connection.
Draft10(Connection)
A draft-draft10 connection.
Draft11(Connection)
A draft-draft11 connection.
Draft12(Connection)
A draft-draft12 connection.
Draft13(Connection)
A draft-draft13 connection.
Draft14(Connection)
A draft-draft14 connection.
Draft15(Connection)
A draft-draft15 connection.
Draft16(Connection)
A draft-draft16 connection.
Draft17(Connection)
A draft-draft17 connection.
Draft18(Connection)
A draft-draft18 connection.
Implementations§
Source§impl AnyConnection
impl AnyConnection
Sourcepub fn draft(&self) -> DraftVersion
pub fn draft(&self) -> DraftVersion
Returns the draft version this connection is using.
Sourcepub fn set_observer(&mut self, observer: Arc<dyn AnyConnectionObserver>)
pub fn set_observer(&mut self, observer: Arc<dyn AnyConnectionObserver>)
Attach an observer. The observer is adapted into the
draft-specific observer trait and installed on the inner
connection; events are forwarded as AnyClientEvent.
Replaces any previously attached observer.
Sourcepub fn clear_observer(&mut self)
pub fn clear_observer(&mut self)
Remove any attached observer.
Source§impl AnyConnection
impl AnyConnection
Sourcepub async fn connect(
addr: &str,
config: AnyClientConfig,
) -> Result<Self, AnyConnectionError>
pub async fn connect( addr: &str, config: AnyClientConfig, ) -> Result<Self, AnyConnectionError>
Connect to a MoQT server using the requested draft. Builds the
draft-specific ClientConfig from the provided AnyClientConfig
and dispatches to the appropriate Connection::connect.
Sourcepub async fn recv_and_dispatch(&mut self) -> Result<(), AnyConnectionError>
pub async fn recv_and_dispatch(&mut self) -> Result<(), AnyConnectionError>
Read and dispatch one control message on the active draft. Draft-specific control-message return values are discarded because event delivery goes through the attached observer; callers only care about success/failure.
Sourcepub async fn unsubscribe(
&mut self,
request_id: VarInt,
) -> Result<(), AnyConnectionError>
pub async fn unsubscribe( &mut self, request_id: VarInt, ) -> Result<(), AnyConnectionError>
Send an UNSUBSCRIBE for the given request ID. Identical across all drafts.
Sourcepub async fn subscribe(
&mut self,
namespace: TrackNamespace,
track_name: Vec<u8>,
subscriber_priority: u8,
group_order: GroupOrder,
filter_type: FilterType,
) -> Result<VarInt, AnyConnectionError>
pub async fn subscribe( &mut self, namespace: TrackNamespace, track_name: Vec<u8>, subscriber_priority: u8, group_order: GroupOrder, filter_type: FilterType, ) -> Result<VarInt, AnyConnectionError>
Send a SUBSCRIBE with the given filter, priority, and group order. Supported on drafts 12–17. Drafts 15–17 carry priority/order/filter via parameters; this helper passes an empty parameter list, so those fields default to protocol-defined values on those drafts.
Sourcepub async fn fetch(
&mut self,
namespace: TrackNamespace,
track_name: Vec<u8>,
start_group: VarInt,
start_object: VarInt,
end_group: VarInt,
end_object: VarInt,
) -> Result<VarInt, AnyConnectionError>
pub async fn fetch( &mut self, namespace: TrackNamespace, track_name: Vec<u8>, start_group: VarInt, start_object: VarInt, end_group: VarInt, end_object: VarInt, ) -> Result<VarInt, AnyConnectionError>
Send a standalone FETCH. Supported on drafts 14–17. On draft 14 the
end_group/end_object are ignored (draft 14’s wrapper only accepts
a start location).
Sourcepub async fn track_status(
&mut self,
namespace: TrackNamespace,
track_name: Vec<u8>,
) -> Result<VarInt, AnyConnectionError>
pub async fn track_status( &mut self, namespace: TrackNamespace, track_name: Vec<u8>, ) -> Result<VarInt, AnyConnectionError>
Send a TRACK_STATUS query for the given track. Supported on drafts 14–17. On drafts 15–17, passes an empty parameter list.
Sourcepub async fn subscribe_namespace(
&mut self,
namespace_prefix: TrackNamespace,
) -> Result<VarInt, AnyConnectionError>
pub async fn subscribe_namespace( &mut self, namespace_prefix: TrackNamespace, ) -> Result<VarInt, AnyConnectionError>
Send a SUBSCRIBE_NAMESPACE (or SUBSCRIBE_ANNOUNCES on drafts 11–12). Supported on drafts 11–17. Drafts 16–17 pass default subscribe options and an empty parameter list.
Sourcepub async fn subscribe_update(
&mut self,
subscription_request_id: VarInt,
start_location: Location,
end_group: VarInt,
subscriber_priority: u8,
forward: Forward,
) -> Result<(), AnyConnectionError>
pub async fn subscribe_update( &mut self, subscription_request_id: VarInt, start_location: Location, end_group: VarInt, subscriber_priority: u8, forward: Forward, ) -> Result<(), AnyConnectionError>
Send a SUBSCRIBE_UPDATE for an active subscription. Draft 14 only — earlier/later drafts either don’t expose a matching client wrapper or use a different message shape.