pub trait AsyncHandler:
Send
+ Sync
+ 'static {
// Required method
fn handle<'a>(
&'a self,
msg: CanonicalMessage,
) -> BoxFuture<'a, Result<Handled, HandlerError>>;
}Expand description
A helper trait that allows implementing handlers using native async fn syntax
without the #[async_trait] macro.
Implementations of this trait can be adapted to Handler using SimpleHandler.
Required Methods§
fn handle<'a>( &'a self, msg: CanonicalMessage, ) -> BoxFuture<'a, Result<Handled, HandlerError>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".