pub struct Origin { /* private fields */ }Expand description
A collection of broadcasts, published by potentially multiple clients.
Implementations§
Source§impl Origin
impl Origin
pub fn new() -> Self
Sourcepub fn publish<T: ToString>(&mut self, path: T, broadcast: BroadcastConsumer)
pub fn publish<T: ToString>(&mut self, path: T, broadcast: BroadcastConsumer)
Announce a broadcast, replacing the previous announcement if it exists.
Sourcepub fn consume(&self, path: &str) -> Option<BroadcastConsumer>
pub fn consume(&self, path: &str) -> Option<BroadcastConsumer>
Consume a broadcast by path.
Sourcepub fn announced(&self, prefix: &str) -> AnnounceConsumer
pub fn announced(&self, prefix: &str) -> AnnounceConsumer
Discover any broadcasts published by the remote matching a prefix.
NOTE: The results contain the suffix only.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Origin
impl RefUnwindSafe for Origin
impl Send for Origin
impl Sync for Origin
impl Unpin for Origin
impl UnwindSafe for Origin
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