/// Register an HTTP handler that will respond to any requests. Enables the use of `async/await`
/// syntax in the callback.
Register an HTTP handler that will respond to any requests. Enables the use of `async/await`
syntax in the callback.
Register an HTTP handler that will respond to any requests . Enables the use of ` async / await ` syntax in the callback .
pub fn on_async<T>(mut self, pattern: &str, func: fn(Request, RouteContext<D>) -> T) -> Self
    where
        T: Future<Output = Result<Response>> + 'a,
    {
        self.add_handler(
            pattern,
            Handler::Async(Rc::new(move |req, route| Box::pin(func(req, route)))),
            Method::all(),
        );
        self
    }
pub fn on_async < T > ( mut self , pattern : & str , func : fn ( Request , RouteContext < D > ) -> T ) -> Self where T : Future < Output = Result < Response > > + ' a , { self . add_handler ( pattern , Handler :: Async ( Rc :: new ( move | req , route | Box :: pin ( func ( req , route ) ) ) ) , Method :: all ( ) , ) ; self }
Register an HTTP handler that will respond to any requests.
Register an HTTP handler that will respond to any requests .
mut self
pattern
&str
func
fn(Request, RouteContext<D>) -> T