pub struct Fifo<R, W = R> { /* private fields */ }Expand description
An I/O object representing a Fifo.
Implementations§
Source§impl<R: FromBytes + IntoBytes, W: FromBytes + IntoBytes> Fifo<R, W>
impl<R: FromBytes + IntoBytes, W: FromBytes + IntoBytes> Fifo<R, W>
Sourcepub fn from_fifo(fifo: impl Into<Fifo<R, W>>) -> Self
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.
Sourcepub fn try_write<B: ?Sized + FifoWriteBuffer<W>>(
&self,
cx: &mut Context<'_>,
entries: &B,
) -> Poll<Result<usize, Status>>
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.
NOTE: Only one writer is supported; this will overwrite any waker registered with a previous
invocation to try_write.
Sourcepub fn try_read<B: ?Sized + FifoReadBuffer<R>>(
&self,
cx: &mut Context<'_>,
entries: &mut B,
) -> Poll<Result<usize, Status>>
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.
NOTE: Only one reader is supported; this will overwrite any waker registered with a previous
invocation to try_read.
Trait Implementations§
Source§impl<R: FromBytes + IntoBytes, W: FromBytes + IntoBytes> AsHandleRef for Fifo<R, W>
impl<R: FromBytes + IntoBytes, W: FromBytes + IntoBytes> AsHandleRef for Fifo<R, W>
Source§fn as_handle_ref(&self) -> HandleRef<'_>
fn as_handle_ref(&self) -> HandleRef<'_>
Get a reference to the handle. One important use of such a reference is
for
object_wait_many.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>
impl<R, W> Sync for Fifo<R, W>
impl<R, W> Unpin for Fifo<R, W>
impl<R, W = R> !UnwindSafe for Fifo<R, W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more