pub fn options_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, info| Box::pin(func(req, info)))),
            vec![Method::Options],
        );
        self
    }
/// Register an HTTP handler that will exclusively respond to OPTIONS requests. Enables the use
/// of `async/await` syntax in the callback.
Register an HTTP handler that will exclusively respond to OPTIONS requests. Enables the use
of `async/await` syntax in the callback.
Register an HTTP handler that will exclusively respond to OPTIONS requests . Enables the use of ` async / await ` syntax in the callback .
pub fn options_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, info| Box::pin(func(req, info)))),
            vec![Method::Options],
        );
        self
    }
pub fn options_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 , info | Box :: pin ( func ( req , info ) ) ) ) , vec ! [ Method Options ] , ) ; self }
Register an HTTP handler that will exclusively respond to OPTIONS requests.
Register an HTTP handler that will exclusively respond to OPTIONS requests .
mut self
pattern
&str
func
fn(Request, RouteContext<D>) -> T
mut self
pattern
&str
func
fn(Request, RouteContext<D>) -> T