diff options
| author | Fuwn <[email protected]> | 2022-03-27 11:03:29 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-03-27 11:03:29 +0000 |
| commit | 0b297db77fc297ff3a65d15ced67e2f9b2630c1d (patch) | |
| tree | b97c12c015f8fb76a278161680ddeedeb36899bd /src/handler.rs | |
| parent | docs: add missing dependency (diff) | |
| download | windmark-0b297db77fc297ff3a65d15ced67e2f9b2630c1d.tar.xz windmark-0b297db77fc297ff3a65d15ced67e2f9b2630c1d.zip | |
feat(error_handle): fnmut closure
Diffstat (limited to 'src/handler.rs')
| -rw-r--r-- | src/handler.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/handler.rs b/src/handler.rs index 071926c..f854aea 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -19,8 +19,9 @@ use crate::{returnable::RouteContext, Response}; pub type RouteResponse = fn(RouteContext<'_>) -> Response<'_>; -pub type ErrorResponse = - fn(crate::returnable::ErrorContext<'_>) -> 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 Partial = fn(RouteContext<'_>) -> String; |