Trait SynchronousProxy

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

    // Required methods
    fn from_channel(inner: Channel) -> Self;
    fn into_channel(self) -> Channel;
    fn as_channel(&self) -> &Channel;

    // Provided method
    fn is_closed(&self) -> Result<bool, Status> { ... }
}
Expand description

A type which allows querying a remote FIDL server over a channel, blocking the calling thread.

Required Associated Types§

type Proxy: Proxy<Protocol = Self::Protocol>

The async proxy for the same protocol.

type Protocol: ProtocolMarker<Proxy = Self::Proxy>

The protocol which this Proxy controls.

Required Methods§

fn from_channel(inner: Channel) -> Self

Create a proxy over the given channel.

fn into_channel(self) -> Channel

Convert the proxy back into a channel.

fn as_channel(&self) -> &Channel

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§

fn is_closed(&self) -> Result<bool, Status>

Returns true if the proxy has received the PEER_CLOSED signal.

§Errors

See https://fuchsia.dev/reference/syscalls/object_wait_one?hl=en#errors for a full list of errors. Note that Status::TIMED_OUT errors are converted to Ok(false) and all other errors are propagated.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§