diff options
| author | Fuwn <[email protected]> | 2023-03-29 07:58:05 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-03-29 08:34:11 +0000 |
| commit | 68b508fda73f5458202e6b3abf52778663954f84 (patch) | |
| tree | f9a9dfd15946c9d5429b23b182ec6cbae7073fd6 /src/handler.rs | |
| parent | ci(check): use table toolchain (diff) | |
| download | windmark-68b508fda73f5458202e6b3abf52778663954f84.tar.xz windmark-68b508fda73f5458202e6b3abf52778663954f84.zip | |
refactor(returnable): unify callback context
Diffstat (limited to 'src/handler.rs')
| -rw-r--r-- | src/handler.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/handler.rs b/src/handler.rs index 5377703..15dfd6d 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -16,16 +16,12 @@ // Copyright (C) 2022-2022 Fuwn <[email protected]> // SPDX-License-Identifier: GPL-3.0-only -use crate::{returnable::RouteContext, Response}; +use crate::{returnable, returnable::RouteContext, Response}; pub type RouteResponse = Box<dyn FnMut(RouteContext<'_>) -> Response<'_> + Send + Sync>; -pub type ErrorResponse = Box< - dyn FnMut(crate::returnable::ErrorContext<'_>) -> Response<'_> + Send + Sync, ->; -pub type Callback = Box< - dyn FnMut(&tokio::net::TcpStream, &url::Url, Option<&matchit::Params<'_, '_>>) - + Send - + Sync, ->; +pub type ErrorResponse = + Box<dyn FnMut(returnable::ErrorContext<'_>) -> Response<'_> + Send + Sync>; +pub type Callback = + Box<dyn FnMut(returnable::CallbackContext<'_>) + Send + Sync>; pub type Partial = Box<dyn FnMut(RouteContext<'_>) -> String + Send + Sync>; |