pub trait Proxy:
Sized
+ Send
+ Sync {
type Protocol: ProtocolMarker<Proxy = Self>;
// Required methods
fn from_channel(inner: Channel) -> Self;
fn into_channel(self) -> Result<Channel, Self>;
fn as_channel(&self) -> &Channel;
// Provided methods
fn domain(&self) -> Arc<Client> { ... }
fn on_closed(&self) -> OnFDomainSignals ⓘ { ... }
}Expand description
A type which allows querying a remote FIDL server over a channel.
Required Associated Types§
Sourcetype Protocol: ProtocolMarker<Proxy = Self>
type Protocol: ProtocolMarker<Proxy = Self>
The protocol which this Proxy controls.
Required Methods§
Sourcefn from_channel(inner: Channel) -> Self
fn from_channel(inner: Channel) -> Self
Create a proxy over the given channel.
Sourcefn into_channel(self) -> Result<Channel, Self>
fn into_channel(self) -> Result<Channel, 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.
Sourcefn as_channel(&self) -> &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§
Sourcefn domain(&self) -> Arc<Client>
fn domain(&self) -> Arc<Client>
Get the client supporting this proxy. We call this a “domain” here because:
- Client is especially overloaded in contexts where this is useful.
- We simulate this call for target-side FIDL proxies, so it isn’t always really a client.
Sourcefn on_closed(&self) -> OnFDomainSignals ⓘ
fn on_closed(&self) -> OnFDomainSignals ⓘ
Returns a future that completes when the server receives the
PEER_CLOSED signal.
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.