pub fn route_fn<F>(self, path: &str, cb: F) -> Self
    where
        F: Fn(Request<hyper::Body>) -> Response<Bytes> + Send + Sync + 'static,
    {
        self.route_async(path, move |req| {
            let res = cb(req);
            async move { Ok::<_, BoxError>(res) }
        })
    }
/// Call a closure when the request matches, returning a response
/// to send back.
Call a closure when the request matches, returning a response
to send back.
Call a closure when the request matches returning a response to send back .
pub fn route_fn<F>(self, path: &str, cb: F) -> Self
    where
        F: Fn(Request<hyper::Body>) -> Response<Bytes> + Send + Sync + 'static,
    {
        self.route_async(path, move |req| {
            let res = cb(req);
            async move { Ok::<_, BoxError>(res) }
        })
    }
pub fn route_fn < F > ( self , path : & str , cb : F ) -> Self where F : Fn ( Request < hyper :: Body > ) -> Response < Bytes > + Send + Sync + ' static , { self . route_async ( path , move | req | { let res = cb ( req ) ; async move { Ok :: < _ , BoxError > ( res ) } } ) }
Call a closure when the request matches, returning a response
to send back.
Call a closure when the request matches returning a response to send back .
self
path
&str
cb
F
self
path
&str
cb
F