pub struct Consumer<T> { /* private fields */ }
Expand description
Fifo Consumption Handle
Implementations§
Source§impl<T> Consumer<T>
impl<T> Consumer<T>
Sourcepub fn try_recv_into(&self, storage: &mut dyn Storage<T>) -> usize
pub fn try_recv_into(&self, storage: &mut dyn Storage<T>) -> usize
Tries to receive some items into custom storage.
Sourcepub fn try_recv_many(&self) -> Vec<T>
pub fn try_recv_many(&self) -> Vec<T>
Tries to receive as many items as possible, into a vector.
Sourcepub fn try_recv_exact<const N: usize>(&self) -> Option<[T; N]>
pub fn try_recv_exact<const N: usize>(&self) -> Option<[T; N]>
Tries to receive exactly N
items into an array.
Sourcepub fn insert_waker(&self, waker: Box<Waker>)
pub fn insert_waker(&self, waker: Box<Waker>)
Sets the waker of the current task, to be woken up when new items are available.
Sourcepub fn take_waker(&self) -> Option<Box<Waker>>
pub fn take_waker(&self) -> Option<Box<Waker>>
Tries to take back a previously inserted waker.
Source§impl<T: Unpin> Consumer<T>
impl<T: Unpin> Consumer<T>
Sourcepub fn recv_into<S: AsyncStorage<T>>(&self, storage: S) -> Recv<'_, S, T> ⓘ
pub fn recv_into<S: AsyncStorage<T>>(&self, storage: S) -> Recv<'_, S, T> ⓘ
Receives some items into custom storage, asynchronously.
Sourcepub fn recv_many(&self) -> Recv<'_, Vec<T>, T> ⓘ
pub fn recv_many(&self) -> Recv<'_, Vec<T>, T> ⓘ
Receives as many items as possible, into a vector, asynchronously.
Sourcepub fn recv_exact<const N: usize>(&self) -> RecvExact<'_, N, T>
pub fn recv_exact<const N: usize>(&self) -> RecvExact<'_, N, T>
Receives exactly N
items into an array, asynchronously.
Source§impl<T: Unpin> Consumer<T>
impl<T: Unpin> Consumer<T>
Sourcepub fn recv_into_blocking<S: AsyncStorage<T>>(&self, storage: S) -> S::Output
pub fn recv_into_blocking<S: AsyncStorage<T>>(&self, storage: S) -> S::Output
Receives some items into custom storage, blocking.
This method is only available if you enable the blocking
feature.
Sourcepub fn recv_many_blocking(&self) -> Vec<T>
pub fn recv_many_blocking(&self) -> Vec<T>
Receives as many items as possible, into a vector, blocking.
This method is only available if you enable the blocking
feature.
Sourcepub fn recv_exact_blocking<const N: usize>(&self) -> [T; N]
pub fn recv_exact_blocking<const N: usize>(&self) -> [T; N]
Receives exactly N
items into an array, blocking.
This method is only available if you enable the blocking
feature.
Sourcepub fn recv_blocking(&self) -> T
pub fn recv_blocking(&self) -> T
Receives one item, blocking.
This method is only available if you enable the blocking
feature.