pub trait Streaming {
// Required method
fn listen<'life0, 'async_trait>(
&'life0 self,
callback: Box<dyn Fn(Message) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync + 'async_trait>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Streaming interface to listen message.
Required Methods§
Sourcefn listen<'life0, 'async_trait>(
&'life0 self,
callback: Box<dyn Fn(Message) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync + 'async_trait>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn listen<'life0, 'async_trait>(
&'life0 self,
callback: Box<dyn Fn(Message) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync + 'async_trait>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start listening stream messages. When receive a message, the callback function will be called.