pub trait RemoteService: Service + Sized {
// Required method
fn with_remote_channels(
self,
rx: RecvStream,
tx: SendStream,
) -> Self::Message;
// Provided method
fn remote_handler(local_sender: LocalSender<Self>) -> Handler<Self> { ... }
}
Available on crate feature
rpc
only.Expand description
Extension trait to Service
to create a Service::Message
from a Service
and a pair of QUIC streams.
This trait is auto-implemented when using the crate::rpc_requests
macro.
Required Methods§
Sourcefn with_remote_channels(self, rx: RecvStream, tx: SendStream) -> Self::Message
fn with_remote_channels(self, rx: RecvStream, tx: SendStream) -> Self::Message
Returns the message enum for this request by combining self
(the protocol enum)
with a pair of QUIC streams for tx
and rx
channels.
Provided Methods§
Sourcefn remote_handler(local_sender: LocalSender<Self>) -> Handler<Self>
fn remote_handler(local_sender: LocalSender<Self>) -> Handler<Self>
Creates a Handler
that forwards all messages to a LocalSender
.
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.