pub struct Receiver<'ch, M, T, const N: usize>where
M: RawMutex,{ /* private fields */ }
Expand description
Receive-only access to a Channel
.
Implementations§
Source§impl<'ch, M, T, const N: usize> Receiver<'ch, M, T, N>where
M: RawMutex,
impl<'ch, M, T, const N: usize> Receiver<'ch, M, T, N>where
M: RawMutex,
Sourcepub fn receive(&self) -> ReceiveFuture<'_, M, T, N> ⓘ
pub fn receive(&self) -> ReceiveFuture<'_, M, T, N> ⓘ
Receive the next value.
See Channel::receive()
.
Sourcepub fn ready_to_receive(&self) -> ReceiveReadyFuture<'_, M, T, N> ⓘ
pub fn ready_to_receive(&self) -> ReceiveReadyFuture<'_, M, T, N> ⓘ
Is a value ready to be received in the channel
Sourcepub fn try_receive(&self) -> Result<T, TryReceiveError>
pub fn try_receive(&self) -> Result<T, TryReceiveError>
Attempt to immediately receive the next value.
Sourcepub fn try_peek(&self) -> Result<T, TryReceiveError>where
T: Clone,
pub fn try_peek(&self) -> Result<T, TryReceiveError>where
T: Clone,
Peek at the next value without removing it from the queue.
Sourcepub fn poll_ready_to_receive(&self, cx: &mut Context<'_>) -> Poll<()>
pub fn poll_ready_to_receive(&self, cx: &mut Context<'_>) -> Poll<()>
Allows a poll_fn to poll until the channel is ready to receive
Sourcepub fn poll_receive(&self, cx: &mut Context<'_>) -> Poll<T>
pub fn poll_receive(&self, cx: &mut Context<'_>) -> Poll<T>
Poll the channel for the next item
Sourcepub const fn capacity(&self) -> usize
pub const fn capacity(&self) -> usize
Returns the maximum number of elements the channel can hold.
Sourcepub fn free_capacity(&self) -> usize
pub fn free_capacity(&self) -> usize
Returns the free capacity of the channel.
Sourcepub fn clear(&self)
pub fn clear(&self)
Clears all elements in the channel.
See Channel::clear()
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of elements currently in the channel.
See Channel::len()
Trait Implementations§
Source§impl<'ch, M, T, const N: usize> From<Receiver<'ch, M, T, N>> for DynamicReceiver<'ch, T>where
M: RawMutex,
impl<'ch, M, T, const N: usize> From<Receiver<'ch, M, T, N>> for DynamicReceiver<'ch, T>where
M: RawMutex,
Source§fn from(s: Receiver<'ch, M, T, N>) -> DynamicReceiver<'ch, T>
fn from(s: Receiver<'ch, M, T, N>) -> DynamicReceiver<'ch, T>
Converts to this type from the input type.
Source§impl<'ch, M, T, const N: usize> From<Receiver<'ch, M, T, N>> for SendDynamicReceiver<'ch, T>
impl<'ch, M, T, const N: usize> From<Receiver<'ch, M, T, N>> for SendDynamicReceiver<'ch, T>
Source§fn from(s: Receiver<'ch, M, T, N>) -> SendDynamicReceiver<'ch, T>
fn from(s: Receiver<'ch, M, T, N>) -> SendDynamicReceiver<'ch, T>
Converts to this type from the input type.
Source§impl<'ch, M, T, const N: usize> Stream for Receiver<'ch, M, T, N>where
M: RawMutex,
impl<'ch, M, T, const N: usize> Stream for Receiver<'ch, M, T, N>where
M: RawMutex,
Source§fn poll_next(
self: Pin<&mut Receiver<'ch, M, T, N>>,
cx: &mut Context<'_>,
) -> Poll<Option<<Receiver<'ch, M, T, N> as Stream>::Item>>
fn poll_next( self: Pin<&mut Receiver<'ch, M, T, N>>, cx: &mut Context<'_>, ) -> Poll<Option<<Receiver<'ch, M, T, N> as Stream>::Item>>
Attempt to pull out the next value of this stream, registering the
current task for wakeup if the value is not yet available, and returning
None
if the stream is exhausted. Read moreimpl<'ch, M, T, const N: usize> Copy for Receiver<'ch, M, T, N>where
M: RawMutex,
Auto Trait Implementations§
impl<'ch, M, T, const N: usize> Freeze for Receiver<'ch, M, T, N>
impl<'ch, M, T, const N: usize> !RefUnwindSafe for Receiver<'ch, M, T, N>
impl<'ch, M, T, const N: usize> Send for Receiver<'ch, M, T, N>
impl<'ch, M, T, const N: usize> Sync for Receiver<'ch, M, T, N>
impl<'ch, M, T, const N: usize> Unpin for Receiver<'ch, M, T, N>
impl<'ch, M, T, const N: usize> !UnwindSafe for Receiver<'ch, M, 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