Skip to main content

MessageHandler

Type Alias MessageHandler 

Source
pub type MessageHandler = Arc<dyn Fn(WsClient, Arc<str>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> + Sync + Send>;
Expand description

A type-erased event handler. Receives the originating client and the raw JSON data payload (as borrowed text), returns the handler’s Result.

Aliased Type§

pub struct MessageHandler { /* private fields */ }