Struct fuchsia_async::Fifo

source ·
pub struct Fifo<R, W = R> { /* private fields */ }
Expand description

An I/O object representing a Fifo.

Implementations§

source§

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

source

pub fn from_fifo(fifo: impl Into<Fifo<R, W>>) -> Self

Creates a new Fifo from a previously-created zx::Fifo.

§Panics

If called on a thread that does not have a current async executor.

source

pub fn try_write<B: ?Sized + FifoWriteBuffer<W>>( &self, cx: &mut Context<'_>, entries: &B, ) -> Poll<Result<usize, Status>>

Writes entries to the fifo and registers this Fifo as needing a write on receiving a zx::Status::SHOULD_WAIT.

Returns the number of elements processed.

source

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

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

Trait Implementations§

source§

impl<R, W> AsHandleRef for Fifo<R, W>

source§

fn as_handle_ref(&self) -> HandleRef<'_>

Get a reference to the handle. One important use of such a reference is for object_wait_many.
source§

fn raw_handle(&self) -> u32

Interpret the reference as a raw handle (an integer type). Two distinct handles will have different raw values (so it can perhaps be used as a key in a data structure).
source§

fn signal_handle( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>

Set and clear userspace-accessible signal bits on an object. Wraps the zx_object_signal syscall.
source§

fn wait_handle( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> Result<Signals, Status>

Waits on a handle. Wraps the zx_object_wait_one syscall.
source§

fn wait_async_handle( &self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts, ) -> Result<(), Status>

Causes packet delivery on the given port when the object changes state and matches signals. zx_object_wait_async syscall.
source§

fn get_name(&self) -> Result<Name, Status>

Get the Property::NAME property for this object. Read more
source§

fn set_name(&self, name: &Name) -> Result<(), Status>

Set the Property::NAME property for this object. Read more
source§

fn basic_info(&self) -> Result<HandleBasicInfo, Status>

Wraps the zx_object_get_info syscall for the ZX_INFO_HANDLE_BASIC topic.
source§

fn count_info(&self) -> Result<HandleCountInfo, Status>

Wraps the zx_object_get_info syscall for the ZX_INFO_HANDLE_COUNT topic.
source§

fn get_koid(&self) -> Result<Koid, Status>

Returns the koid (kernel object ID) for this handle.
source§

impl<R, W> AsRef<Fifo<R, W>> for Fifo<R, W>

source§

fn as_ref(&self) -> &Fifo<R, W>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<R, W> Debug for Fifo<R, W>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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

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.
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. Read more
source§

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

Creates a future that receives a single entry. Read more
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.
source§

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

source§

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

Writes entries to the fifo and registers this Fifo as needing a write on receiving a zx::Status::SHOULD_WAIT. Read more
source§

fn write_entries<'a, B: ?Sized + FifoWriteBuffer<W>>( &'a self, entries: &'a B, ) -> WriteEntries<'a, Self, B, W>

Creates a future that transmits entries to be written. Read more
source§

impl<R, W> From<Fifo<R, W>> for Fifo<R, W>

source§

fn from(fifo: Fifo<R, W>) -> Fifo<R, W>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<R, W> Freeze for Fifo<R, W>

§

impl<R, W = R> !RefUnwindSafe for Fifo<R, W>

§

impl<R, W> Send for Fifo<R, W>
where R: Send, W: Send,

§

impl<R, W> Sync for Fifo<R, W>
where R: Sync, W: Sync,

§

impl<R, W> Unpin for Fifo<R, W>
where R: Unpin, W: Unpin,

§

impl<R, W = R> !UnwindSafe for Fifo<R, W>

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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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>,

§

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.