pub struct Receiver<'a, T, N: ArrayLength<Option<T>>> { /* private fields */ }Expand description
The endpoint of a channel for receiving values.
Implementations§
Source§impl<'a, T: Unpin, N: ArrayLength<Option<T>>> Receiver<'a, T, N>
impl<'a, T: Unpin, N: ArrayLength<Option<T>>> Receiver<'a, T, N>
Sourcepub fn receive(&mut self) -> impl Future<Output = Result<T, ()>> + '_
pub fn receive(&mut self) -> impl Future<Output = Result<T, ()>> + '_
Asynchronously receive a value through the channel.
If the channel is empty, this will wait until the sender produces a
value, and then notify that the channel is ready. If the sender has
been dropped and the channel is empty, however, this returns Err(()).
Trait Implementations§
Auto Trait Implementations§
impl<'a, T, N> Freeze for Receiver<'a, T, N>
impl<'a, T, N> RefUnwindSafe for Receiver<'a, T, N>
impl<'a, T, N> Send for Receiver<'a, T, N>where
T: Send,
impl<'a, T, N> Sync for Receiver<'a, T, N>where
T: Sync,
impl<'a, T, N> Unpin for Receiver<'a, T, N>
impl<'a, T, N> !UnwindSafe for Receiver<'a, T, N>
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