Trait fuchsia_async::FifoReadable

source ·
pub trait FifoReadable<R: FifoEntry>
where Self: Sized,
{ // Required method fn read<B: ?Sized + FifoReadBuffer<R>>( &self, cx: &mut Context<'_>, entries: &mut B, ) -> Poll<Result<usize, Status>>; // Provided methods fn read_entries<'a, B: ?Sized + FifoReadBuffer<R>>( &'a self, entries: &'a mut B, ) -> ReadEntries<'a, Self, B, R> { ... } fn read_entry<'a>(&'a self) -> ReadOne<'a, Self, R> { ... } fn read_one(&self, cx: &mut Context<'_>) -> Poll<Result<R, Status>> { ... } }
Expand description

Identifies that the object may be used to read entries from a FIFO.

Required Methods§

source

fn read<B: ?Sized + FifoReadBuffer<R>>( &self, cx: &mut Context<'_>, entries: &mut B, ) -> Poll<Result<usize, Status>>

Reads entries from the fifo and registers this Fifo as needing a read on receiving a zx::Status::SHOULD_WAIT.

Provided Methods§

source

fn read_entries<'a, B: ?Sized + FifoReadBuffer<R>>( &'a self, entries: &'a mut B, ) -> ReadEntries<'a, Self, B, R>

Creates a future that receives entries into entries.

The returned future will return after the FIFO becomes readable and up to entries.len() has been received. The future will resolve to the number of elements written into entries.

source

fn read_entry<'a>(&'a self) -> ReadOne<'a, Self, R>

Creates a future that receives a single entry.

The returned future will return after the FIFO becomes readable and a single entry is available.

source

fn read_one(&self, cx: &mut Context<'_>) -> Poll<Result<R, Status>>

Reads a single entry and registers this Fifo as needing a read on receiving a zx::Status::SHOULD_WAIT.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<R: FifoEntry, W: FifoEntry> FifoReadable<R> for Fifo<R, W>