aboutsummaryrefslogtreecommitdiff
path: root/src/handler.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-03-29 08:28:56 +0000
committerFuwn <[email protected]>2023-03-29 08:34:11 +0000
commite7f05fc3b45e3e068e8a8373782e7f519f40690d (patch)
treeb101bcfa9960ca7c7cbf9c2b735fb105b78357c8 /src/handler.rs
parentrefactor(returnable): unify callback context (diff)
downloadwindmark-e7f05fc3b45e3e068e8a8373782e7f519f40690d.tar.xz
windmark-e7f05fc3b45e3e068e8a8373782e7f519f40690d.zip
feat(router): modify content from post-route callback
Diffstat (limited to 'src/handler.rs')
-rw-r--r--src/handler.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/handler.rs b/src/handler.rs
index 15dfd6d..c5e23e8 100644
--- a/src/handler.rs
+++ b/src/handler.rs
@@ -16,12 +16,17 @@
// Copyright (C) 2022-2022 Fuwn <[email protected]>
// SPDX-License-Identifier: GPL-3.0-only
-use crate::{returnable, returnable::RouteContext, Response};
+use crate::{
+ returnable,
+ returnable::{CallbackContext, RouteContext},
+ Response,
+};
pub type RouteResponse =
Box<dyn FnMut(RouteContext<'_>) -> Response<'_> + 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 Callback = Box<dyn FnMut(CallbackContext<'_>) + Send + Sync>;
+pub type CleanupCallback =
+ Box<dyn FnMut(CallbackContext<'_>, &mut String) + Send + Sync>;
pub type Partial = Box<dyn FnMut(RouteContext<'_>) -> String + Send + Sync>;