pub trait MessageConsumer<T: Send + Sync>: Send + Sync {
// Required methods
fn subscribe<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topics: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn recv<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<Message<T>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn pause<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn resume<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A consumer that receives messages from a broker.
Required Methods§
Provided Methods§
Sourcefn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close or shut down the consumer. Implementations with no persistent resources may no-op.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".