pub struct ReceiveHalf<'a, T: Send + 'static, const N: usize> { /* private fields */ }Expand description
The receiving half of a Channel.
Implementations§
Source§impl<'a, T: Send + 'static, const N: usize> ReceiveHalf<'a, T, N>
impl<'a, T: Send + 'static, const N: usize> ReceiveHalf<'a, T, N>
Sourcepub fn receive(&mut self) -> impl Future<Output = T> + Send + '_
pub fn receive(&mut self) -> impl Future<Output = T> + Send + '_
Obtain a future which resolves with a value received from the channel.
The receiving operation is atomic, and will only actually remove the
element from the channel in the process of resolving to a
Poll::Ready value.
Sourcepub fn try_receive(&mut self) -> Option<T>
pub fn try_receive(&mut self) -> Option<T>
Try to receive a value, returning None if the channel is empty.
Auto Trait Implementations§
impl<'a, T, const N: usize> !RefUnwindSafe for ReceiveHalf<'a, T, N>
impl<'a, T, const N: usize> !Sync for ReceiveHalf<'a, T, N>
impl<'a, T, const N: usize> !UnwindSafe for ReceiveHalf<'a, T, N>
impl<'a, T, const N: usize> Freeze for ReceiveHalf<'a, T, N>
impl<'a, T, const N: usize> Send for ReceiveHalf<'a, T, N>
impl<'a, T, const N: usize> Unpin for ReceiveHalf<'a, T, N>
impl<'a, T, const N: usize> UnsafeUnpin for ReceiveHalf<'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