pub trait MessageBus<M: MessageBounds>: Send + Sync {
// Required methods
fn publish<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
message: Arc<M>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn request_timeout(&self) -> Duration;
fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Subscription<M>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn request<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
message: Arc<M>,
) -> Pin<Box<dyn Future<Output = Result<Arc<M>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Generic MessageBus trait
Required Methods§
Sourcefn publish<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
message: Arc<M>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn publish<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
message: Arc<M>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Publish a message Note async but not defined as such because this is used dynamically
Sourcefn request_timeout(&self) -> Duration
fn request_timeout(&self) -> Duration
Get the request_timeout