Struct fidl::handle::AsyncChannel
pub struct AsyncChannel(/* private fields */);
Expand description
An I/O object representing a Channel
.
Implementations§
§impl Channel
impl Channel
pub fn from_channel(channel: Channel) -> Channel
pub fn from_channel(channel: Channel) -> Channel
Creates a new Channel
from a previously-created zx::Channel
.
§Panics
If called outside the context of an active async executor.
pub fn into_zx_channel(self) -> Channel
pub fn into_zx_channel(self) -> Channel
Consumes self
and returns the underlying zx::Channel
.
pub fn on_closed(&self) -> OnSignals<'_, Unowned<'_, Handle>> ⓘ
pub fn on_closed(&self) -> OnSignals<'_, Unowned<'_, Handle>> ⓘ
Returns a future that completes when is_closed()
is true.
pub 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
.
pub 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
.
pub 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
.
pub 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
.
pub 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.
pub 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§
§impl AsHandleRef for Channel
impl AsHandleRef for Channel
§fn as_handle_ref(&self) -> Unowned<'_, Handle>
fn as_handle_ref(&self) -> Unowned<'_, Handle>
object_wait_many
.source§fn raw_handle(&self) -> u32
fn raw_handle(&self) -> u32
source§fn signal_handle(
&self,
clear_mask: Signals,
set_mask: Signals,
) -> Result<(), Status>
fn signal_handle( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>
source§fn wait_handle(
&self,
signals: Signals,
deadline: Instant<MonotonicTimeline>,
) -> Result<Signals, Status>
fn wait_handle( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> Result<Signals, Status>
source§fn wait_async_handle(
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts,
) -> Result<(), Status>
fn wait_async_handle( &self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts, ) -> Result<(), Status>
source§fn get_name(&self) -> Result<Name, Status>
fn get_name(&self) -> Result<Name, Status>
source§fn set_name(&self, name: &Name) -> Result<(), Status>
fn set_name(&self, name: &Name) -> Result<(), Status>
source§fn basic_info(&self) -> Result<HandleBasicInfo, Status>
fn basic_info(&self) -> Result<HandleBasicInfo, Status>
source§fn count_info(&self) -> Result<HandleCountInfo, Status>
fn count_info(&self) -> Result<HandleCountInfo, Status>
source§impl ChannelEpitaphExt for AsyncChannel
impl ChannelEpitaphExt for AsyncChannel
source§impl ChannelLike for AsyncChannel
impl ChannelLike for AsyncChannel
source§fn write_epitaph(&self, bytes: &[u8]) -> Result<(), TransportError>
fn write_epitaph(&self, bytes: &[u8]) -> Result<(), TransportError>
source§impl ProxyChannelFor<DefaultFuchsiaResourceDialect> for AsyncChannel
impl ProxyChannelFor<DefaultFuchsiaResourceDialect> for AsyncChannel
§type Boxed = FuchsiaProxyBox
type Boxed = FuchsiaProxyBox
ProxyChannel
when using it within a client.