Struct Subscription
pub struct Subscription { /* private fields */ }Expand description
One SUBSCRIBE (draft-14 §9.7). It is read either by object (next) or by
subgroup stream (next_group), whichever is called first.
Implementations§
§impl Subscription
impl Subscription
pub fn done(&self) -> impl Future<Output = Option<PublishDone>> + 'static
pub fn done(&self) -> impl Future<Output = Option<PublishDone>> + 'static
Resolves once the publisher ends the subscription with PUBLISH_DONE,
or to None once the session ends or close is called without one.
pub async fn next(&self) -> Result<Option<ReceivedObject>, Error>
pub async fn next(&self) -> Result<Option<ReceivedObject>, Error>
The next object; None once the track has no more streams. Objects
of one subgroup come in order; status objects are skipped. Fails once
next_group read the subscription.
pub async fn next_group(&self) -> Result<Option<Group>, Error>
pub async fn next_group(&self) -> Result<Option<Group>, Error>
The next subgroup stream; None once the track has no more streams.
Fails for a track delivered in datagrams, and once next read the
subscription.
pub async fn set_forward(&self, forward: bool) -> Result<(), Error>
pub async fn set_forward(&self, forward: bool) -> Result<(), Error>
SUBSCRIBE_UPDATE with the Forward flag (draft-14 §9.10).
pub async fn set_priority(&self, priority: u8) -> Result<(), Error>
pub async fn set_priority(&self, priority: u8) -> Result<(), Error>
SUBSCRIBE_UPDATE with the Subscriber Priority (draft-14 §7.1), by which the relay orders what it has not sent yet.
pub async fn request_new_group(
&self,
largest_group: Option<u64>,
) -> Result<bool, Error>
pub async fn request_new_group( &self, largest_group: Option<u64>, ) -> Result<bool, Error>
Asks the publisher to start a new group (NEW_GROUP_REQUEST, draft-18
§10.2.13). largest_group is the largest group ID of the track the
caller has seen. Returns false, without sending, for a track
without dynamic groups.
pub async fn end_before_group(&self, group_id: u64) -> Result<(), Error>
pub async fn end_before_group(&self, group_id: u64) -> Result<(), Error>
SUBSCRIBE_UPDATE ending the subscription before group_id (draft-14
§9.10); the publisher sends PUBLISH_DONE once it has sent the groups
below it.