From c69f40fc8f4bfe2c6b0bac64966d647fb313a02c Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 27 Mar 2022 11:13:24 +0000 Subject: feat(pre/post_route_callback): fnmut closure --- src/handler.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/handler.rs') diff --git a/src/handler.rs b/src/handler.rs index f854aea..b1e6afe 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -22,6 +22,9 @@ pub type RouteResponse = fn(RouteContext<'_>) -> Response<'_>; pub type ErrorResponse = Box< dyn FnMut(crate::returnable::ErrorContext<'_>) -> Response<'_> + Send + Sync, >; -pub type Callback = - fn(&tokio::net::TcpStream, &url::Url, Option<&matchit::Params<'_, '_>>); +pub type Callback = Box< + dyn FnMut(&tokio::net::TcpStream, &url::Url, Option<&matchit::Params<'_, '_>>) + + Send + + Sync, +>; pub type Partial = fn(RouteContext<'_>) -> String; -- cgit v1.2.3