pub struct TrackConsumer {
pub info: Track,
/* private fields */
}Expand description
A consumer for a track, used to read groups.
Fields§
§info: TrackImplementations§
Source§impl TrackConsumer
impl TrackConsumer
Sourcepub fn poll_next_group(
&mut self,
waiter: &Waiter,
) -> Poll<Result<Option<GroupConsumer>>>
pub fn poll_next_group( &mut self, waiter: &Waiter, ) -> Poll<Result<Option<GroupConsumer>>>
Poll for the next group without blocking.
Returns Poll::Ready(Some(Ok(group))) when a group is available,
Poll::Ready(None) when the track is finished,
Poll::Ready(Some(Err(e))) when the track has been aborted, or
Poll::Pending when no group is available yet.
Sourcepub async fn next_group(&mut self) -> Result<Option<GroupConsumer>>
pub async fn next_group(&mut self) -> Result<Option<GroupConsumer>>
Return the next group in order.
NOTE: This can have gaps if the reader is too slow or there were network slowdowns.
Sourcepub fn poll_get_group(
&self,
waiter: &Waiter,
sequence: u64,
) -> Poll<Result<Option<GroupConsumer>>>
pub fn poll_get_group( &self, waiter: &Waiter, sequence: u64, ) -> Poll<Result<Option<GroupConsumer>>>
Poll for the group with the given sequence, without blocking.
Sourcepub async fn get_group(&self, sequence: u64) -> Result<Option<GroupConsumer>>
pub async fn get_group(&self, sequence: u64) -> Result<Option<GroupConsumer>>
Block until the group with the given sequence is available.
Returns None if the group is not in the cache and a newer group exists.
Sourcepub fn poll_closed(&self, waiter: &Waiter) -> Poll<Result<()>>
pub fn poll_closed(&self, waiter: &Waiter) -> Poll<Result<()>>
Poll for track closure, without blocking.
Sourcepub async fn closed(&self) -> Result<()>
pub async fn closed(&self) -> Result<()>
Block until the track is closed.
Returns Ok() is the track was cleanly finished.
pub fn is_clone(&self, other: &Self) -> bool
Sourcepub fn poll_finished(&mut self, waiter: &Waiter) -> Poll<Result<u64>>
pub fn poll_finished(&mut self, waiter: &Waiter) -> Poll<Result<u64>>
Poll for the total number of groups in the track.
Trait Implementations§
Source§impl Clone for TrackConsumer
impl Clone for TrackConsumer
Source§fn clone(&self) -> TrackConsumer
fn clone(&self) -> TrackConsumer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more