Host

pub trait Host: Send {
    // Required methods
    fn request(
        &mut self,
        subject: String,
        body: Vec<u8>,
        timeout_ms: u32,
    ) -> impl Future<Output = Result<Result<BrokerMessage, String>>> + Send;
    fn publish(
        &mut self,
        msg: BrokerMessage,
    ) -> impl Future<Output = Result<Result<(), String>>> + Send;
}

Required Methods§

Source

fn request( &mut self, subject: String, body: Vec<u8>, timeout_ms: u32, ) -> impl Future<Output = Result<Result<BrokerMessage, String>>> + Send

Perform a request operation on a subject

Source

fn publish( &mut self, msg: BrokerMessage, ) -> impl Future<Output = Result<Result<(), String>>> + Send

Publish a message to a subject without awaiting a response

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.

Implementations on Foreign Types§

Source§

impl<_T: Host + ?Sized + Send> Host for &mut _T

Source§

fn request( &mut self, subject: String, body: Vec<u8>, timeout_ms: u32, ) -> impl Future<Output = Result<Result<BrokerMessage, String>>> + Send

Perform a request operation on a subject

Source§

fn publish( &mut self, msg: BrokerMessage, ) -> impl Future<Output = Result<Result<(), String>>> + Send

Publish a message to a subject without awaiting a response

Implementors§

Source§

impl<H> Host for Ctx<H>
where H: Handler,