jetstream_rpc

Trait Protocol

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,
        frame: Frame<Self::Request>,
    ) -> impl Future<Output = Result<Frame<Self::Response>, Self::Error>> + Send + Sync + Sized;
}

Defines the request and response types for the JetStream protocol.

Required Associated Constants

const VERSION: &'static str

Required Associated Types

type Request: Framer

type Response: Framer

type Error: Error + Send + Sync + 'static

Required Methods

fn rpc( &mut self, frame: FrameSelf::Request, ) -> impl Future<Output = Result<FrameSelf::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