async_fifo::fifo

Struct Consumer

Source
pub struct Consumer<T> { /* private fields */ }
Expand description

Fifo Consumption Handle

Implementations§

Source§

impl<T> Consumer<T>

Source

pub fn try_recv_into(&self, storage: &mut dyn Storage<T>) -> usize

Tries to receive some items into custom storage.

Source

pub fn try_recv_many(&self) -> Vec<T>

Tries to receive as many items as possible, into a vector.

Source

pub fn try_recv_exact<const N: usize>(&self) -> Option<[T; N]>

Tries to receive exactly N items into an array.

Source

pub fn try_recv(&self) -> Option<T>

Tries to receive one item.

Source

pub fn insert_waker(&self, waker: Box<Waker>)

Sets the waker of the current task, to be woken up when new items are available.

Source

pub fn take_waker(&self) -> Option<Box<Waker>>

Tries to take back a previously inserted waker.

Source§

impl<T: Unpin> Consumer<T>

Source

pub fn recv_into<S: AsyncStorage<T>>(&self, storage: S) -> Recv<'_, S, T>

Receives some items into custom storage, asynchronously.

Source

pub fn recv_many(&self) -> Recv<'_, Vec<T>, T>

Receives as many items as possible, into a vector, asynchronously.

Source

pub fn recv_exact<const N: usize>(&self) -> RecvExact<'_, N, T>

Receives exactly N items into an array, asynchronously.

Source

pub fn recv(&self) -> RecvOne<'_, T>

Receives one item, asynchronously.

Source§

impl<T: Unpin> Consumer<T>

Source

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.

Source

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.

Source

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.

Source

pub fn recv_blocking(&self) -> T

Receives one item, blocking.

This method is only available if you enable the blocking feature.

Trait Implementations§

Source§

impl<T> Send for Consumer<T>

Source§

impl<T> Sync for Consumer<T>

Auto Trait Implementations§

§

impl<T> Freeze for Consumer<T>

§

impl<T> !RefUnwindSafe for Consumer<T>

§

impl<T> Unpin for Consumer<T>

§

impl<T> !UnwindSafe for Consumer<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.