From 68b508fda73f5458202e6b3abf52778663954f84 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 29 Mar 2023 07:58:05 +0000 Subject: refactor(returnable): unify callback context --- src/handler.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/handler.rs') 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 // SPDX-License-Identifier: GPL-3.0-only -use crate::{returnable::RouteContext, Response}; +use crate::{returnable, returnable::RouteContext, Response}; pub type RouteResponse = Box) -> 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) -> Response<'_> + Send + Sync>; +pub type Callback = + Box) + Send + Sync>; pub type Partial = Box) -> String + Send + Sync>; -- cgit v1.2.3