[−][src]Struct barrage::SharedReceiver
A shared receiver is similar to a receiver, but it shares a mailbox with the other shared receivers from which it originates (was cloned from). Thus, only one shared receiver with the same mailbox will receive a broadcast.
Implementations
impl<T: Clone + Unpin> SharedReceiver<T>
[src]
pub fn same_mailbox(&self, other: &SharedReceiver<T>) -> bool
[src]
Checks whether this shared receiver shares a mailbox with another.
pub fn recv(&self) -> Result<T, Disconnected>
[src]
Receive a broadcast message. If there are none in the queue, it will block until another is sent or all senders disconnect.
pub fn try_recv(&self) -> Result<Option<T>, Disconnected>
[src]
Try to receive a broadcast message. If there are none in the queue, it will return None
, or
if there are no senders it will return Disconnected
.
pub fn recv_async(&self) -> RecvFut<'_, T>ⓘ
[src]
Receive a broadcast message. If there are none in the queue, it will asynchronously wait until another is sent or all senders disconnect.
Trait Implementations
impl<T: Clone + Unpin> Clone for SharedReceiver<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for SharedReceiver<T>
impl<T> Send for SharedReceiver<T> where
T: Send + Sync,
T: Send + Sync,
impl<T> Sync for SharedReceiver<T> where
T: Send + Sync,
T: Send + Sync,
impl<T> Unpin for SharedReceiver<T>
impl<T> !UnwindSafe for SharedReceiver<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,