pub trait MessageHandler: Send + Sync {
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
message: ReceivedMessage<Value>,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareResult, WorkerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A message handler that processes messages.
This trait represents a single step in the middleware chain. Handlers can be middleware components or final workers.
Required Methods§
Sourcefn handle<'life0, 'async_trait>(
&'life0 self,
message: ReceivedMessage<Value>,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareResult, WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
message: ReceivedMessage<Value>,
) -> Pin<Box<dyn Future<Output = Result<MiddlewareResult, WorkerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".