fuchsia_async

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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