pub struct StochasticMpmcReceiver<T>(/* private fields */);
Expand description
Receiver for a stochastic MPMC channel. Create one using stochastic_channel()
. This receiver can be cheaply cloned, which will increase the receiver count. Dropping a receiver will decrease the receiver count.
Implementations§
Source§impl<T> StochasticMpmcReceiver<T>
impl<T> StochasticMpmcReceiver<T>
Sourcepub fn try_recv(&self) -> Result<Option<T>, StochasticMpmcRecvError>
pub fn try_recv(&self) -> Result<Option<T>, StochasticMpmcRecvError>
Receive an item, or return None if no items are available right now. If there are no senders, an error is returned.
Sourcepub fn recv_timeout(
&self,
timeout: Duration,
) -> Result<T, StochasticMpmcRecvTimeoutError>
pub fn recv_timeout( &self, timeout: Duration, ) -> Result<T, StochasticMpmcRecvTimeoutError>
Block the current thread until an item can be received, time has run out, or there are no more senders. If time has run out or there are no more senders, an error is returned.
Sourcepub fn recv(&self) -> Result<T, StochasticMpmcRecvError>
pub fn recv(&self) -> Result<T, StochasticMpmcRecvError>
Block the current thread until an item can be received or there are no more senders. If there are no more senders, an error is returned.
Trait Implementations§
Source§impl<T> Clone for StochasticMpmcReceiver<T>
impl<T> Clone for StochasticMpmcReceiver<T>
Source§impl<T> Drop for StochasticMpmcReceiver<T>
impl<T> Drop for StochasticMpmcReceiver<T>
Source§impl<T> IntoIterator for StochasticMpmcReceiver<T>
impl<T> IntoIterator for StochasticMpmcReceiver<T>
Auto Trait Implementations§
impl<T> Freeze for StochasticMpmcReceiver<T>
impl<T> RefUnwindSafe for StochasticMpmcReceiver<T>
impl<T> Send for StochasticMpmcReceiver<T>where
T: Send,
impl<T> Sync for StochasticMpmcReceiver<T>where
T: Send,
impl<T> Unpin for StochasticMpmcReceiver<T>
impl<T> UnwindSafe for StochasticMpmcReceiver<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