pub struct BroadcastReceiver<T> { /* private fields */ }Expand description
Receiving side of a broadcast channel.
Each receiver owns a dedicated queue and therefore observes every message independently of other receivers.
Implementations§
Source§impl<T> Receiver<T>
impl<T> Receiver<T>
Sourcepub fn recv(&self) -> Result<T, RecvError>
pub fn recv(&self) -> Result<T, RecvError>
Blocks until the next value arrives.
Returns mpsc::RecvError after all senders have been dropped and the
queue has been drained.
Sourcepub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutError>
pub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutError>
Blocks until the next value arrives or the timeout expires.
This is primarily useful in tests and in integration code that must avoid waiting forever for control-plane events.
Auto Trait Implementations§
impl<T> Freeze for Receiver<T>
impl<T> RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T>where
T: Send,
impl<T> !Sync for Receiver<T>
impl<T> Unpin for Receiver<T>
impl<T> UnsafeUnpin for Receiver<T>
impl<T> UnwindSafe for Receiver<T>
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