aboutsummaryrefslogtreecommitdiff
path: root/src/handler.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-03-27 11:13:24 +0000
committerFuwn <[email protected]>2022-03-27 11:13:24 +0000
commitc69f40fc8f4bfe2c6b0bac64966d647fb313a02c (patch)
treec95a22a6e2cc76318b539be9acac9e7f0274e962 /src/handler.rs
parentfeat(error_handle): fnmut closure (diff)
downloadwindmark-c69f40fc8f4bfe2c6b0bac64966d647fb313a02c.tar.xz
windmark-c69f40fc8f4bfe2c6b0bac64966d647fb313a02c.zip
feat(pre/post_route_callback): fnmut closure
Diffstat (limited to 'src/handler.rs')
-rw-r--r--src/handler.rs7
1 files changed, 5 insertions, 2 deletions
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;