Protocol

Trait Protocol 

Source
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§

Source

const VERSION: &'static str

Required Associated Types§

Required Methods§

Source

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.

Implementors§