Trait wasmcloud_runtime::capability::messaging::consumer::Host

source ·
pub trait Host: Send {
    // Required methods
    fn request<'life0, 'async_trait>(
        &'life0 mut self,
        subject: String,
        body: Vec<u8>,
        timeout_ms: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Result<BrokerMessage, String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn publish<'life0, 'async_trait>(
        &'life0 mut self,
        msg: BrokerMessage,
    ) -> Pin<Box<dyn Future<Output = Result<Result<(), String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn request<'life0, 'async_trait>( &'life0 mut self, subject: String, body: Vec<u8>, timeout_ms: u32, ) -> Pin<Box<dyn Future<Output = Result<Result<BrokerMessage, String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform a request operation on a subject

source

fn publish<'life0, 'async_trait>( &'life0 mut self, msg: BrokerMessage, ) -> Pin<Box<dyn Future<Output = Result<Result<(), String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Publish a message to a subject without awaiting a response

Implementations on Foreign Types§

source§

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

source§

fn request<'life0, 'async_trait>( &'life0 mut self, subject: String, body: Vec<u8>, timeout_ms: u32, ) -> Pin<Box<dyn Future<Output = Result<Result<BrokerMessage, String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform a request operation on a subject

source§

fn publish<'life0, 'async_trait>( &'life0 mut self, msg: BrokerMessage, ) -> Pin<Box<dyn Future<Output = Result<Result<(), String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Publish a message to a subject without awaiting a response

Implementors§