diff options
| author | Fuwn <[email protected]> | 2022-03-27 11:13:24 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-03-27 11:13:24 +0000 |
| commit | c69f40fc8f4bfe2c6b0bac64966d647fb313a02c (patch) | |
| tree | c95a22a6e2cc76318b539be9acac9e7f0274e962 /src/handler.rs | |
| parent | feat(error_handle): fnmut closure (diff) | |
| download | windmark-c69f40fc8f4bfe2c6b0bac64966d647fb313a02c.tar.xz windmark-c69f40fc8f4bfe2c6b0bac64966d647fb313a02c.zip | |
feat(pre/post_route_callback): fnmut closure
Diffstat (limited to 'src/handler.rs')
| -rw-r--r-- | src/handler.rs | 7 |
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; |