pub struct Receiver<T: Copy + 'static, const N: usize> { /* private fields */ }Expand description
Multi-consumer half of an ove::channel.
Implementations§
Source§impl<T: Copy + 'static, const N: usize> Receiver<T, N>
impl<T: Copy + 'static, const N: usize> Receiver<T, N>
Sourcepub const unsafe fn from_static(
queue: &'static Queue<T, N>,
tx_count: &'static AtomicUsize,
rx_count: &'static AtomicUsize,
) -> Self
pub const unsafe fn from_static( queue: &'static Queue<T, N>, tx_count: &'static AtomicUsize, rx_count: &'static AtomicUsize, ) -> Self
Construct a receiver from caller-owned static state. See
Sender::from_static for the safety + count-initialisation
contract.
§Safety
Same as Sender::from_static.
Sourcepub fn recv(&self) -> Result<T>
pub fn recv(&self) -> Result<T>
Receive an item. Blocks until a sender posts, or returns
Error::NetClosed when every Sender has been dropped and
the queue is empty.
Sourcepub fn try_recv(&self) -> Result<T>
pub fn try_recv(&self) -> Result<T>
Non-blocking receive. Returns Error::Timeout when empty
and senders are still alive; Error::NetClosed when empty and
all senders are gone.
Sourcepub fn sender_count(&self) -> usize
pub fn sender_count(&self) -> usize
Number of currently-live Sender handles.
Sourcepub fn receiver_count(&self) -> usize
pub fn receiver_count(&self) -> usize
Number of currently-live Receiver handles.
Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Receiver<T, N>
impl<T, const N: usize> RefUnwindSafe for Receiver<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Receiver<T, N>where
T: Send,
impl<T, const N: usize> Sync for Receiver<T, N>where
T: Send,
impl<T, const N: usize> Unpin for Receiver<T, N>
impl<T, const N: usize> UnsafeUnpin for Receiver<T, N>
impl<T, const N: usize> UnwindSafe for Receiver<T, N>where
T: RefUnwindSafe,
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