Struct zircon_object::ipc::Fifo [−][src]
First-In First-Out inter-process queue.
SYNOPSIS
FIFOs are intended to be the control plane for shared memory transports.
Their read and write operations are more efficient than sockets
or channels
,
but there are severe restrictions on the size of elements and buffers.
Implementations
impl Fifo
[src]
pub fn create(elem_count: usize, elem_size: usize) -> (Arc<Self>, Arc<Self>)
[src]
Create a FIFO.
pub fn write(
&self,
elem_size: usize,
data: &[u8],
count: usize
) -> ZxResult<usize>
[src]
&self,
elem_size: usize,
data: &[u8],
count: usize
) -> ZxResult<usize>
Write data to the FIFO.
This attempts to write up to count
elements (count * elem_size
bytes)
from data
to the fifo.
Fewer elements may be written than requested if there is insufficient room in the fifo to contain all of them.
The number of elements actually written is returned.
count
must be nonzero.
pub fn read(
&self,
elem_size: usize,
data: &mut [u8],
count: usize
) -> ZxResult<usize>
[src]
&self,
elem_size: usize,
data: &mut [u8],
count: usize
) -> ZxResult<usize>
Read data from the FIFO.
This attempts to read up to count
elements from the fifo into data
.
Fewer elements may be read than requested if there are insufficient elements in the fifo to fulfill the entire request. The number of elements actually read is returned.
The elem_size
must match the element size that was passed into Fifo::create()
.
data
must have a size of count * elem_size
bytes.
count
must be nonzero.
Trait Implementations
impl Debug for Fifo
[src]
impl Drop for Fifo
[src]
impl KernelObject for Fifo
[src]
fn id(&self) -> KoID
[src]
fn type_name(&self) -> &str
[src]
fn name(&self) -> String
[src]
fn set_name(&self, name: &str)
[src]
fn signal(&self) -> Signal
[src]
fn signal_set(&self, signal: Signal)
[src]
fn signal_clear(&self, signal: Signal)
[src]
fn signal_change(&self, clear: Signal, set: Signal)
[src]
fn add_signal_callback(&self, callback: SignalHandler)
[src]
fn peer(&self) -> ZxResult<Arc<dyn KernelObject>>
[src]
fn related_koid(&self) -> KoID
[src]
fn get_child(&self, _id: KoID) -> ZxResult<Arc<dyn KernelObject>>
[src]
fn allowed_signals(&self) -> Signal
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Fifo
impl Send for Fifo
impl Sync for Fifo
impl Unpin for Fifo
impl !UnwindSafe for Fifo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,