pub struct Lister { /* private fields */ }Expand description
A handler’s answer to the broadcast’s listings, from Requests::lister.
A broadcast has at most one. While it exists, readers wait for it to
sync before reporting TracksEvent::Synced. Answer while poll_wanted: list what the
publisher behind the handler holds and keep it current, then clear
once poll_unwanted. Dropping it clears what it listed.
Implementations§
Source§impl Lister
impl Lister
Sourcepub fn poll_wanted(&self, waiter: &Waiter) -> Poll<Result<(), Error>>
pub fn poll_wanted(&self, waiter: &Waiter) -> Poll<Result<(), Error>>
Ready once anyone lists the broadcast; Error::Closed once it ended.
Sourcepub fn poll_unwanted(&self, waiter: &Waiter) -> Poll<Result<(), Error>>
pub fn poll_unwanted(&self, waiter: &Waiter) -> Poll<Result<(), Error>>
Ready once nobody lists the broadcast; Error::Closed once it ended.
Sourcepub fn add(
&self,
name: impl Into<Arc<str>>,
info: impl Into<Listed>,
) -> Result<(), Error>
pub fn add( &self, name: impl Into<Arc<str>>, info: impl Into<Listed>, ) -> Result<(), Error>
List a track of the kind info is: a track::Info or a datagram::Info. Fails
with Error::Duplicate if this answer already lists that kind and name.
Sourcepub fn remove(&self, kind: Kind, name: impl Into<Arc<str>>) -> Result<(), Error>
pub fn remove(&self, kind: Kind, name: impl Into<Arc<str>>) -> Result<(), Error>
Stop listing a track that left unfinished, reported as TracksEvent::Removed.
Fails with Error::NotFound if this answer does not list that kind and name.
Sourcepub fn finish(&self, kind: Kind, name: impl Into<Arc<str>>) -> Result<(), Error>
pub fn finish(&self, kind: Kind, name: impl Into<Arc<str>>) -> Result<(), Error>
Stop listing a track that finished, reported as TracksEvent::Finished. Fails with
Error::NotFound if this answer does not list that kind and name.