fuchsia_async

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

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.