pub trait Protocol:
Send
+ Sync
+ Send
+ Sync
+ Sized {
type Request: Framer;
type Response: Framer;
type Error: Error + Send + Sync + 'static;
const VERSION: &'static str;
// Required method
fn rpc(
&mut self,
context: Context,
frame: Frame<Self::Request>,
) -> impl Future<Output = Result<Frame<Self::Response>, Self::Error>> + Send + Sync + Sized;
}
Expand description
Defines the request and response types for the JetStream protocol.
Required Associated Constants§
Required Associated Types§
type Request: Framer
type Response: Framer
type Error: Error + Send + Sync + 'static
Required Methods§
fn rpc( &mut self, context: Context, frame: Frame<Self::Request>, ) -> impl Future<Output = Result<Frame<Self::Response>, Self::Error>> + Send + Sync + Sized
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.