Skip to main content

AsyncHandlerFn

Type Alias AsyncHandlerFn 

Source
pub type AsyncHandlerFn = fn(RequestParts, Vec<u8>, &str, Arc<dyn Any + Send + Sync>) -> Pin<Box<dyn Future<Output = Result<ResponseParts, Error>> + Send>>;
Expand description

Async handler function type for hyper integration

Takes request parts, body bytes, content-type, application context, and returns response parts. The context is passed as Arc<dyn Any> and downcasted to the concrete type by the #[route] macro wrapper.