Struct magenta::Fifo
[−]
[src]
pub struct Fifo(_);
An object representing a Magenta fifo.
As essentially a subtype of Handle
, it can be freely interconverted.
Methods
impl Fifo
[src]
fn create(
elem_count: u32,
elem_size: u32,
options: FifoOpts
) -> Result<(Fifo, Fifo), Status>
elem_count: u32,
elem_size: u32,
options: FifoOpts
) -> Result<(Fifo, Fifo), Status>
Create a pair of fifos and return their endpoints. Writing to one endpoint enqueues an element into the fifo from which the opposing endpoint reads. Wraps the mx_fifo_create syscall.
fn write(&self, bytes: &[u8]) -> Result<u32, Status>
Attempts to write some number of elements into the fifo. The number of bytes written will be rounded down to a multiple of the fifo's element size. Return value (on success) is number of elements actually written.
Wraps mx_fifo_write.
fn read(&self, bytes: &mut [u8]) -> Result<u32, Status>
Attempts to read some number of elements out of the fifo. The number of bytes read will always be a multiple of the fifo's element size. Return value (on success) is number of elements actually read.
Wraps mx_fifo_read.
Trait Implementations
impl Debug for Fifo
[src]
impl Eq for Fifo
[src]
impl PartialEq for Fifo
[src]
fn eq(&self, __arg_0: &Fifo) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Fifo) -> bool
This method tests for !=
.
impl AsHandleRef for Fifo
[src]
fn as_handle_ref(&self) -> HandleRef
Get a reference to the handle. One important use of such a reference is for object_wait_many
. Read more
fn raw_handle(&self) -> mx_handle_t
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). Read more
fn signal_handle(
&self,
clear_mask: Signals,
set_mask: Signals
) -> Result<(), Status>
&self,
clear_mask: Signals,
set_mask: Signals
) -> Result<(), Status>
Set and clear userspace-accessible signal bits on an object. Wraps the mx_object_signal syscall. Read more
fn wait_handle(
&self,
signals: Signals,
deadline: mx_time_t
) -> Result<Signals, Status>
&self,
signals: Signals,
deadline: mx_time_t
) -> Result<Signals, Status>
Waits on a handle. Wraps the mx_object_wait_one syscall. Read more
fn wait_async_handle(
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts
) -> Result<(), Status>
&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. mx_object_wait_async syscall. Read more
impl From<Handle> for Fifo
[src]
impl Into<Handle> for Fifo
[src]
impl HandleBased for Fifo
[src]
fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
Duplicate a handle, possibly reducing the rights available. Wraps the mx_handle_duplicate syscall. Read more
fn replace_handle(self, rights: Rights) -> Result<Self, Status>
Create a replacement for a handle, possibly reducing the rights available. This invalidates the original handle. Wraps the mx_handle_replace syscall. Read more