subspace_farmer::cluster::nats_client

Trait GenericRequest

source
pub trait GenericRequest:
    Encode
    + Decode
    + Debug
    + Send
    + Sync
    + 'static {
    type Response: Encode + Decode + Debug + Send + Sync + 'static;

    const SUBJECT: &'static str;
}
Expand description

Generic request with associated response.

Used for cases where request/response pattern is needed and response contains a single small message. For large messages or multiple messages chunking with GenericStreamRequest can be used instead.

Required Associated Constants§

source

const SUBJECT: &'static str

Request subject with optional * in place of application instance to receive the request

Required Associated Types§

source

type Response: Encode + Decode + Debug + Send + Sync + 'static

Response type that corresponds to this request

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§