Trait fidl::encoding::ProxyChannelBox

source ·
pub trait ProxyChannelBox<D: ResourceDialect>: Debug + Send + Sync {
    // Required methods
    fn recv_etc_from(
        &self,
        ctx: &mut Context<'_>,
        buf: &mut D::MessageBufEtc,
    ) -> Poll<Result<(), Option<<D::ProxyChannel as ProxyChannelFor<D>>::Error>>>;
    fn as_channel(&self) -> &D::ProxyChannel;
    fn write_etc(
        &self,
        bytes: &[u8],
        handles: &mut [<D::ProxyChannel as ProxyChannelFor<D>>::HandleDisposition],
    ) -> Result<(), Option<<D::ProxyChannel as ProxyChannelFor<D>>::Error>>;
    fn is_closed(&self) -> bool;
    fn unbox(self) -> D::ProxyChannel;
}
Expand description

Trait for a “Box” that wraps a handle when it’s inside a client. Useful when we need some infrastructure to make our underlying channels work the way the client code expects.

Required Methods§

source

fn recv_etc_from( &self, ctx: &mut Context<'_>, buf: &mut D::MessageBufEtc, ) -> Poll<Result<(), Option<<D::ProxyChannel as ProxyChannelFor<D>>::Error>>>

Receives a message on the channel and registers this Channel as needing a read on receiving a io::std::ErrorKind::WouldBlock.

source

fn as_channel(&self) -> &D::ProxyChannel

Get a reference to the boxed channel.

source

fn write_etc( &self, bytes: &[u8], handles: &mut [<D::ProxyChannel as ProxyChannelFor<D>>::HandleDisposition], ) -> Result<(), Option<<D::ProxyChannel as ProxyChannelFor<D>>::Error>>

Write data to a Proxy channel

source

fn is_closed(&self) -> bool

Return whether a ProxyChannel is closed.

source

fn unbox(self) -> D::ProxyChannel

Unbox this channel

Implementors§