pub fn wrap_fn<F, T, U>(func: F) -> WrapFn<F> where
F: Fn(T) -> U,
T: Filter,
U: Filter,
Expand description
Function that receives a filter to be combined with pre and after filters
21
22
23
24
25
26
27
28
29
30
31
async fn main() {
let routes = warp::any()
.map(|| "hello world")
.boxed()
.recover(|_err| async { Ok("recovered") })
.with(warp::wrap_fn(hello_wrapper));
warp::serve(routes).run(([127, 0, 0, 1], 3030)).await;
}