Trait fidl::endpoints::Proxy

source ·
pub trait Proxy: Sized + Send + Sync {
    type Protocol: ProtocolMarker<Proxy = Self>;

    // Required methods
    fn from_channel(inner: AsyncChannel) -> Self;
    fn into_channel(self) -> Result<AsyncChannel, Self>;
    fn as_channel(&self) -> &AsyncChannel;

    // Provided methods
    fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self> { ... }
    fn is_closed(&self) -> bool { ... }
    fn on_closed(&self) -> OnSignals<'_>  { ... }
}
Expand description

A type which allows querying a remote FIDL server over a channel.

Required Associated Types§

source

type Protocol: ProtocolMarker<Proxy = Self>

The protocol which this Proxy controls.

Required Methods§

source

fn from_channel(inner: AsyncChannel) -> Self

Create a proxy over the given channel.

source

fn into_channel(self) -> Result<AsyncChannel, Self>

Attempt to convert the proxy back into a channel.

This will only succeed if there are no active clones of this proxy and no currently-alive EventStream or response futures that came from this proxy.

source

fn as_channel(&self) -> &AsyncChannel

Get a reference to the proxy’s underlying channel.

This should only be used for non-effectful operations. Reading or writing to the channel is unsafe because the proxy assumes it has exclusive control over these operations.

Provided Methods§

source

fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>

Attempt to convert the proxy back into a client end.

This will only succeed if there are no active clones of this proxy and no currently-alive EventStream or response futures that came from this proxy.

source

fn is_closed(&self) -> bool

Returns true if the proxy has received the PEER_CLOSED signal.

source

fn on_closed(&self) -> OnSignals<'_>

Returns a future that completes when the proxy receives the PEER_CLOSED signal.

Object Safety§

This trait is not object safe.

Implementors§