pub trait ConnectedProtocol {
type Protocol: Proxy;
type ConnectError: Display;
type Message;
type SendError: Display;
// Required methods
fn get_protocol<'a>(
&'a mut self,
) -> BoxFuture<'a, Result<Self::Protocol, Self::ConnectError>>;
fn send_message<'a>(
&'a mut self,
protocol: &'a Self::Protocol,
msg: Self::Message,
) -> BoxFuture<'a, Result<(), Self::SendError>>;
}
Expand description
A trait for implementing connecting to and sending messages to a FIDL protocol.
Required Associated Types§
Sourcetype ConnectError: Display
type ConnectError: Display
An error type returned for connection failures.
Required Methods§
Sourcefn get_protocol<'a>(
&'a mut self,
) -> BoxFuture<'a, Result<Self::Protocol, Self::ConnectError>>
fn get_protocol<'a>( &'a mut self, ) -> BoxFuture<'a, Result<Self::Protocol, Self::ConnectError>>
Connects to the protocol represented by Protocol
.
If this is a two-step process as in the case of the ServiceHub pattern, both steps should be performed in this function.