pub struct OriginConsumer { /* private fields */ }Expand description
Consumes announced broadcasts matching against an optional prefix.
Implementations§
Source§impl OriginConsumer
impl OriginConsumer
Sourcepub async fn next(&mut self) -> Option<OriginUpdate>
pub async fn next(&mut self) -> Option<OriginUpdate>
Returns the next (un)announced broadcast and the absolute path.
The broadcast will only be None if it was previously Some. The same path won’t be announced/unannounced twice, instead it will toggle.
Note: The returned path is absolute and will always match this consumer’s prefix.
Sourcepub fn consume<'a>(
&self,
suffix: impl Into<PathRef<'a>>,
) -> Option<BroadcastConsumer>
pub fn consume<'a>( &self, suffix: impl Into<PathRef<'a>>, ) -> Option<BroadcastConsumer>
Get a specific broadcast by path.
This is relative to the consumer’s prefix. Returns None if the path hasn’t been announced yet.
pub fn consume_all(&self) -> OriginConsumer
pub fn consume_prefix<'a>( &self, prefix: impl Into<PathRef<'a>>, ) -> OriginConsumer
pub fn prefix(&self) -> &Path
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OriginConsumer
impl RefUnwindSafe for OriginConsumer
impl Send for OriginConsumer
impl Sync for OriginConsumer
impl Unpin for OriginConsumer
impl UnwindSafe for OriginConsumer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more