Struct fuchsia_async::Channel
source · pub struct Channel(/* private fields */);
Expand description
An I/O object representing a Channel
.
Implementations§
source§impl Channel
impl Channel
sourcepub fn from_channel(channel: Channel) -> Result<Self, Status>
pub fn from_channel(channel: Channel) -> Result<Self, Status>
Creates a new Channel
from a previously-created zx::Channel
.
sourcepub fn into_zx_channel(self) -> Channel
pub fn into_zx_channel(self) -> Channel
Consumes self
and returns the underlying zx::Channel
.
sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Returns true if the channel received the OBJECT_PEER_CLOSED
signal.
sourcepub fn on_closed<'a>(&'a self) -> OnSignals<'a> ⓘ
pub fn on_closed<'a>(&'a self) -> OnSignals<'a> ⓘ
Returns a future that completes when is_closed()
is true.
sourcepub fn read(
&self,
cx: &mut Context<'_>,
bytes: &mut Vec<u8>,
handles: &mut Vec<Handle>
) -> Poll<Result<(), Status>>
pub fn read( &self, cx: &mut Context<'_>, bytes: &mut Vec<u8>, handles: &mut Vec<Handle> ) -> Poll<Result<(), Status>>
Receives a message on the channel and registers this Channel
as
needing a read on receiving a zx::Status::SHOULD_WAIT
.
Identical to recv_from
except takes separate bytes and handles buffers
rather than a single MessageBuf
.
sourcepub fn read_etc(
&self,
cx: &mut Context<'_>,
bytes: &mut Vec<u8>,
handles: &mut Vec<HandleInfo>
) -> Poll<Result<(), Status>>
pub fn read_etc( &self, cx: &mut Context<'_>, bytes: &mut Vec<u8>, handles: &mut Vec<HandleInfo> ) -> Poll<Result<(), Status>>
Receives a message on the channel and registers this Channel
as
needing a read on receiving a zx::Status::SHOULD_WAIT
.
Identical to recv_etc_from
except takes separate bytes and handles
buffers rather than a single MessageBufEtc
.
sourcepub fn recv_from(
&self,
cx: &mut Context<'_>,
buf: &mut MessageBuf
) -> Poll<Result<(), Status>>
pub fn recv_from( &self, cx: &mut Context<'_>, buf: &mut MessageBuf ) -> Poll<Result<(), Status>>
Receives a message on the channel and registers this Channel
as
needing a read on receiving a zx::Status::SHOULD_WAIT
.
sourcepub fn recv_etc_from(
&self,
cx: &mut Context<'_>,
buf: &mut MessageBufEtc
) -> Poll<Result<(), Status>>
pub fn recv_etc_from( &self, cx: &mut Context<'_>, buf: &mut MessageBufEtc ) -> Poll<Result<(), Status>>
Receives a message on the channel and registers this Channel
as
needing a read on receiving a zx::Status::SHOULD_WAIT
.
sourcepub fn recv_msg<'a>(&'a self, buf: &'a mut MessageBuf) -> RecvMsg<'a> ⓘ
pub fn recv_msg<'a>(&'a self, buf: &'a mut MessageBuf) -> RecvMsg<'a> ⓘ
Creates a future that receive a message to be written to the buffer provided.
The returned future will return after a message has been received on this socket and been placed into the buffer.
sourcepub fn recv_etc_msg<'a>(&'a self, buf: &'a mut MessageBufEtc) -> RecvEtcMsg<'a>
pub fn recv_etc_msg<'a>(&'a self, buf: &'a mut MessageBufEtc) -> RecvEtcMsg<'a>
Creates a future that receive a message to be written to the buffer provided.
The returned future will return after a message has been received on this socket and been placed into the buffer.
Trait Implementations§
source§impl AsHandleRef for Channel
impl AsHandleRef for Channel
source§fn as_handle_ref(&self) -> HandleRef<'_>
fn as_handle_ref(&self) -> HandleRef<'_>
object_wait_many
.