Struct fuchsia_zircon::Channel
[−]
[src]
pub struct Channel(_);
An object representing a Zircon channel.
As essentially a subtype of Handle
, it can be freely interconverted.
Methods
impl Channel
[src]
fn create() -> Result<(Channel, Channel), Status>
[src]
Create a channel, resulting an a pair of Channel
objects representing both
sides of the channel. Messages written into one maybe read from the opposite.
Wraps the zx_channel_create syscall.
fn read_raw(
&self,
buf: &mut MessageBuf
) -> Result<Result<(), Status>, (usize, usize)>
[src]
&self,
buf: &mut MessageBuf
) -> Result<Result<(), Status>, (usize, usize)>
Read a message from a channel. Wraps the zx_channel_read syscall.
If the MessageBuf
lacks the capacity to hold the pending message,
returns an Err
with the number of bytes and number of handles needed.
Otherwise returns an Ok
with the result as usual.
fn read(&self, buf: &mut MessageBuf) -> Result<(), Status>
[src]
Read a message from a channel.
Note that this method can cause internal reallocations in the MessageBuf
if it is lacks capacity to hold the full message. If such reallocations
are not desirable, use read_raw
instead.
fn write(&self, bytes: &[u8], handles: &mut Vec<Handle>) -> Result<(), Status>
[src]
Write a message to a channel. Wraps the zx_channel_write syscall.
fn call(
&self,
timeout: Time,
bytes: &[u8],
handles: &mut Vec<Handle>,
buf: &mut MessageBuf
) -> Result<(), (Status, Status)>
[src]
&self,
timeout: Time,
bytes: &[u8],
handles: &mut Vec<Handle>,
buf: &mut MessageBuf
) -> Result<(), (Status, Status)>
Send a message consisting of the given bytes and handles to a channel and await a reply. The bytes should start with a four byte 'txid' which is used to identify the matching reply.
Wraps the zx_channel_call syscall.
Note that unlike read
, the caller must ensure that the MessageBuf has enough
capacity for the bytes and handles which will be received, as replies which are too large
are discarded.
On failure returns the both the main and read status.
Trait Implementations
impl Debug for Channel
[src]
impl Eq for Channel
[src]
impl PartialEq for Channel
[src]
fn eq(&self, __arg_0: &Channel) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Channel) -> bool
[src]
This method tests for !=
.
impl Hash for Channel
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl AsHandleRef for Channel
[src]
fn as_handle_ref(&self) -> HandleRef
[src]
Get a reference to the handle. One important use of such a reference is for object_wait_many
. Read more
fn raw_handle(&self) -> zx_handle_t
[src]
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>
[src]
&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. Read more
fn wait_handle(
&self,
signals: Signals,
deadline: Time
) -> Result<Signals, Status>
[src]
&self,
signals: Signals,
deadline: Time
) -> Result<Signals, Status>
Waits on a handle. Wraps the zx_object_wait_one syscall. Read more
fn wait_async_handle(
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts
) -> Result<(), Status>
[src]
&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. Read more
impl From<Handle> for Channel
[src]
impl HandleBased for Channel
[src]
fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
[src]
Duplicate a handle, possibly reducing the rights available. Wraps the zx_handle_duplicate syscall. Read more
fn replace_handle(self, rights: Rights) -> Result<Self, Status>
[src]
Create a replacement for a handle, possibly reducing the rights available. This invalidates the original handle. Wraps the zx_handle_replace syscall. Read more
fn into_handle(self) -> Handle
[src]
Converts the value into its inner handle. Read more
fn into_raw(self) -> zx_handle_t
[src]
Converts the handle into it's raw representation. Read more
fn from_handle(handle: Handle) -> Self
[src]
Creates an instance of this type from a handle. Read more
fn into_handle_based<H: HandleBased>(self) -> H
[src]
Creates an instance of another handle-based type from this value's inner handle.
fn from_handle_based<H: HandleBased>(h: H) -> Self
[src]
Creates an instance of this type from the inner handle of another handle-based type. Read more
impl Peered for Channel
[src]
fn signal_peer(
&self,
clear_mask: Signals,
set_mask: Signals
) -> Result<(), Status>
[src]
&self,
clear_mask: Signals,
set_mask: Signals
) -> Result<(), Status>
Set and clear userspace-accessible signal bits on the object's peer. Wraps the zx_object_signal_peer syscall. Read more