pub struct Receiver<T>(/* private fields */);Available on crate feature
alloc only.Expand description
The receiving half of the channel. This half can be cloned and is
bound to the hosting channel through the reference counted Rc.
Implementations§
Source§impl<T> Receiver<T>
impl<T> Receiver<T>
Sourcepub fn try_recv(&self) -> Result<T, TryRecvError>
pub fn try_recv(&self) -> Result<T, TryRecvError>
Attempts to receive a value of the channel without waiting.
This can fail for two reasons:
- The channel is closed, i.e.
closehas been called. - The message buffer is empty.
Sourcepub fn recv(&self) -> RecvFuture<'_, dyn RingBuf<Item = T>> ⓘ
pub fn recv(&self) -> RecvFuture<'_, dyn RingBuf<Item = T>> ⓘ
Returns a future that gets fulfilled when a value is written to the
channel. If the channels get closed, the future will resolve to an
Err variant.
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> !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