pub struct Consumer { /* private fields */ }Expand description
Receives announce / unannounce events for a subtree.
Created by Consumer::announced or AnnounceProducer::consume.
Drop to unregister.
Implementations§
Source§impl AnnounceConsumer
impl AnnounceConsumer
Sourcepub async fn next(&mut self) -> Option<OriginAnnounce>
pub async fn next(&mut self) -> Option<OriginAnnounce>
Returns the next (un)announced broadcast and its path relative to this cursor’s root.
The broadcast will only be announced if it was previously unannounced. The same path won’t be announced/unannounced twice in a row; instead it toggles. Returns None if the cursor is closed.
Sourcepub fn poll_next(&mut self, waiter: &Waiter) -> Poll<Option<OriginAnnounce>>
pub fn poll_next(&mut self, waiter: &Waiter) -> Poll<Option<OriginAnnounce>>
Poll for the next (un)announced broadcast, without blocking.
Returns Poll::Ready(Some(_)) for an update, Poll::Ready(None) if the
cursor is closed, or Poll::Pending after registering waiter to be
notified when the next update arrives.
Sourcepub fn try_next(&mut self) -> Option<OriginAnnounce>
pub fn try_next(&mut self) -> Option<OriginAnnounce>
Returns the next (un)announced broadcast without blocking.
Returns None if there is no update available; NOT because the cursor is closed.
Use Self::is_closed to check if the cursor is closed.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Returns true if the cursor is closed (no more updates will arrive).