Struct TrackWriter
pub struct TrackWriter { /* private fields */ }Expand description
A track Session::publish_track registered with the session’s Origin,
which numbers and caches what is written and answers the track’s
SUBSCRIBE, FETCH and TRACK_STATUS.
Implementations§
§impl TrackWriter
impl TrackWriter
pub async fn write(
&self,
payload: Bytes,
new_group: bool,
extension_headers: ExtensionHeaders,
) -> Result<Option<u64>, Error>
pub async fn write( &self, payload: Bytes, new_group: bool, extension_headers: ExtensionHeaders, ) -> Result<Option<u64>, Error>
Writes one object, starting a new group with it when new_group.
extension_headers carry, for instance, the object’s LOC properties
(draft-ietf-moq-loc-04). Returns the object’s group id when a
subscriber took it, and None otherwise; it is cached either way. An
object within a group that was never started is dropped.
pub async fn write_group(&self, payload: Bytes) -> Result<Option<u64>, Error>
pub async fn write_group(&self, payload: Bytes) -> Result<Option<u64>, Error>
Sends payload as a group of its own, the layout of an MSF catalog
(draft-ietf-moq-msf-02 §5). Returns the group’s id when a subscriber
took it, and None otherwise.
pub async fn next_subscriber(&self) -> bool
pub async fn next_subscriber(&self) -> bool
Returns true once a SUBSCRIBE for the track is answered, and
false once the session has ended: the moment to send what a new
subscriber needs, since its SUBSCRIBE starts after the largest
object. A later publish_track of the same track takes the
notifications over.