pub trait MessageHandler: Send + Sync {
// Required method
fn on_message<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 MessageContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn on_sync_buf_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
_sync_buf: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn on_shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
The handler trait users implement to receive messages.
Required Methods§
Sourcefn on_message<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 MessageContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_message<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 MessageContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called for each inbound user message.
Provided Methods§
Sourcefn on_sync_buf_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
_sync_buf: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_sync_buf_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
_sync_buf: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when get_updates_buf changes — persist it here.