Skip to main content

AsyncHandler

Trait AsyncHandler 

Source
pub trait AsyncHandler<S>:
    RouteSpec
    + Send
    + Sync
    + 'static {
    // Required method
    fn handle_async(
        &self,
        request: Request,
        params: PathParams,
        connection: ConnectionInfo,
        state: Arc<S>,
    ) -> Pin<Box<dyn Future<Output = Response> + Send>>;
}
Expand description

A typed handler for AsyncAppWithState (http2): the route macros make one from an async fn, and from every sync typed handler too.

Required Methods§

Source

fn handle_async( &self, request: Request, params: PathParams, connection: ConnectionInfo, state: Arc<S>, ) -> Pin<Box<dyn Future<Output = Response> + Send>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§