pub trait Handler:
Send
+ Sync
+ 'static {
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
ctx: Context,
) -> Pin<Box<dyn Future<Output = BotResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Core trait for all update handlers.
Implementors receive a Context and return a future resolving to
BotResult<()>.
The return value does not influence routing. The dispatcher runs only the
first route whose filter matches, and an Err is logged rather than
propagated or passed to another handler — so returning an error reports a
failure, it does not hand control anywhere else.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".