Skip to main content

Module track

Module track 

Source
Expand description

A track is a collection of semi-reliable and semi-ordered streams, split into a Producer and Subscriber handle.

A Producer creates streams with a key and priority. The key is used to determine the order of streams, while the priority is used to determine which stream to transmit first. This may seem counter-intuitive, but is designed for live streaming where the newest streams may be higher priority. A cloned Producer can be used to create streams in parallel, but will error if a duplicate key is used.

A Subscriber may not receive all streams in order or at all. These streams are meant to be transmitted over congested networks and the key to MoQ Transport is to not block on them. Streams will be cached for a potentially limited duration added to the unreliable nature. A Consumer is a cheap, cloneable handle; subscribing it multiple times fans the same cached streams out to each independent Subscriber.

The track is closed with Error when all writers or readers are dropped.

Structs§

AbortHandle
Aborts a track without keeping it open, from Producer::abort_handle.
Consumer
A lazy handle to a single track within a broadcast.
Control
A cloneable handle to a subscriber’s delivery preferences.
Demand
A cloneable, watch-only handle to a track’s subscriber demand.
Fetching
The pollable state of a Consumer::fetch_group.
FillGroups
A run of groups readers miss, for a Requests handler to serve.
Finished
A track whose producer finished it: its end is declared, and it can still take or serve an older group below that end, be read, or be aborted, but not append.
Info
Publisher-side properties of a track.
Ordered
A Subscriber that reads groups in key order.
Position
A frame-precise point in a track: a group, by its start, and a frame index within it.
Producer
A producer for a track, used to create new groups.
Range
A span of a track to deliver: from where Self::start places it through the group containing end, a time in the track’s timescale (a bare start on a scale-less track).
Refresh
When a reader of a track asks its publisher for a new group, which TRACK_INFO carries.
Refreshing
A Subscriber::refresh request, resolving once it is sent. Dropping it before then withdraws the request.
Request
A subscriber asked for a track this broadcast doesn’t have yet.
Requests
Serves the groups a track’s readers miss, the group-level analogue of broadcast::Requests.
Resolving
The pollable state of a Consumer::info; awaited via the [kio::Pending] wrapper.
Subscriber
A live subscription to a track, used to read its groups.
Subscribing
The pollable state of a Consumer::subscribe; awaited via the [kio::Pending] wrapper, whose DerefMut exposes Self::update.
Subscription
Subscriber-side preferences for receiving a track.

Enums§

Compression
How a track’s frames are compressed, with the values TRACK_INFO’s Compression field carries.
Item
What Ordered::poll_next_item returns next.
Order
Which of a subscription’s groups comes first: the publisher sends its pending groups in this order, and recv_group hands out the groups it holds in it. Before moq-lite-07 the publisher sends newest first whatever this asks.
Start
Where a Range starts.