/// Register an HTTP handler that will respond to all methods that are not handled explicitly by
/// other handlers. Enables the use of `async/await` syntax in the callback.
Register an HTTP handler that will respond to all methods that are not handled explicitly by
other handlers. Enables the use of `async/await` syntax in the callback.
Register an HTTP handler that will respond to all methods that are not handled explicitly by other handlers . Enables the use of ` async / await ` syntax in the callback .
pub fn or_else_any_method_async<T>(
        mut self,
        pattern: &str,
        func: fn(Request, RouteContext<D>) -> T,
    ) -> Self
    where
        T: Future<Output = Result<Response>> + 'a,
    {
        self.or_else_any_method
            .insert(
                pattern,
                Handler::Async(Rc::new(move |req, route| Box::pin(func(req, route)))),
            )
            .unwrap_or_else(|e| panic!("failed to register route for {} pattern: {}", pattern, e));
        self
    }
pub fn or_else_any_method_async < T > ( mut self , pattern : & str , func : fn ( Request , RouteContext < D > ) -> T , ) -> Self where T : Future < Output = Result < Response > > + ' a , { self . or_else_any_method . insert ( pattern , Handler :: Async ( Rc :: new ( move | req , route | Box :: pin ( func ( req , route ) ) ) ) , ) . unwrap_or_else ( | e | panic ! ( " " pattern e ) ) ; self }
Register an HTTP handler that will respond to all methods that are not handled explicitly by
other handlers.
Register an HTTP handler that will respond to all methods that are not handled explicitly by other handlers .
mut self
pattern
&str
func
fn(Request, RouteContext<D>) -> T