Skip to main content

Requester

Trait Requester 

Source
pub trait Requester {
    // Required method
    fn request<C>(
        &self,
        cmd: C,
    ) -> impl Future<Output = Result<<C as Command>::Reply, Error>> + Send
       where C: Command;
}
Expand description

Re-exported so services only need to depend on arminius-lib-nats.

The message-bus Subscriber trait is intentionally not re-exported here to avoid clashing with the async_nats::Subscriber re-export above; reach it via arminius_lib_message_bus::Subscriber. Sends commands and awaits typed replies. Mirrors Publisher.

Required Methods§

Source

fn request<C>( &self, cmd: C, ) -> impl Future<Output = Result<<C as Command>::Reply, Error>> + Send
where C: Command,

Send cmd and wait for a typed reply.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> Requester for Arc<T>
where T: Requester + Sync,

Source§

fn request<C>( &self, cmd: C, ) -> impl Future<Output = Result<<C as Command>::Reply, Error>> + Send
where C: Command,

Implementors§