pub trait Service<P: Protocol>:
Send
+ Sync
+ Sized {
// Required method
fn rpc(
self,
req: P::Request,
) -> impl Future<Output = Result<P::Response, Error>> + Send + Sync + Sized;
// Provided method
fn handle_message<R, W>(
self,
reader: &mut R,
writer: &mut W,
) -> impl Future<Output = Result<(), Error>> + Send + Sync + Sized
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.