pub trait Service:
Protocol
+ Send
+ Sync {
// Required method
fn rpc(
&mut self,
req: Self::Request,
) -> impl Future<Output = Result<Self::Response, Error>> + Send + Sync;
// Provided method
fn handle_message<R, W>(
&mut self,
reader: &mut R,
writer: &mut W,
) -> impl Future<Output = Result<(), Error>> + Send + Sync
where R: AsyncReadExt + Unpin + Send + Sync,
W: AsyncWriteExt + Unpin + Send + Sync { ... }
}Expand description
An asynchronous JetStream service that can handle RPC calls and messages.
Required Methods§
Provided Methods§
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.