pub struct Receiver<T> { /* private fields */ }Implementations§
Source§impl<T> Receiver<T>
impl<T> Receiver<T>
pub fn new(chan: Arc<ConcurrentQueue<T>>) -> Self
Sourcepub fn chan(&self) -> Arc<ConcurrentQueue<T>> ⓘ
pub fn chan(&self) -> Arc<ConcurrentQueue<T>> ⓘ
Get a clone of the underlying channel Arc
pub fn capacity(&self) -> Option<usize>
pub fn len(&self) -> usize
pub fn is_closed(&self) -> bool
pub fn close(&self) -> bool
pub fn is_full(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn try_iter(&self) -> TryIter<'_, T> ⓘ
pub fn into_recv_iter_timeout(&self, duration: Duration) -> RecvIterator<T> ⓘ
pub fn into_recv_iter(&self) -> RecvIterator<T> ⓘ
pub fn recv(&self) -> Result<T, ReceiverError>
Sourcepub fn recv_timeout(&self, dur: Duration) -> Result<T, ReceiverError>
pub fn recv_timeout(&self, dur: Duration) -> Result<T, ReceiverError>
recv_timeout attempts to read value from the channel within the specified duration.
It internally uses std::thread::park_timeout to block the current thread
for a given duration until a value is received or the timeout is reached.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Receiver<T>
impl<T> RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T>
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