Trait ProxyChannelBox

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

fn recv_etc_from( &self, ctx: &mut Context<'_>, buf: &mut <D as ResourceDialect>::MessageBufEtc, ) -> Poll<Result<(), Option<<<D as ResourceDialect>::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.

fn as_channel(&self) -> &<D as ResourceDialect>::ProxyChannel

Get a reference to the boxed channel.

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

Write data to a Proxy channel

fn is_closed(&self) -> bool

Return whether a ProxyChannel is closed.

fn unbox(self) -> <D as ResourceDialect>::ProxyChannel

Unbox this channel

Implementors§