From a6a61d5be2d508caf145e7d33fcbbd173fa8a356 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 4 Apr 2023 09:33:14 +0000 Subject: feat(module): async module support --- src/module.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/module.rs') diff --git a/src/module.rs b/src/module.rs index 0c2a67b..e9ac743 100644 --- a/src/module.rs +++ b/src/module.rs @@ -16,15 +16,9 @@ // Copyright (C) 2022-2022 Fuwn // SPDX-License-Identifier: GPL-3.0-only -use crate::{context::HookContext, Router}; +mod asynchronous; +mod sync; -pub trait Module { - /// Called right after the module is attached. - fn on_attach(&mut self, _: &mut Router) {} - - /// Called before a route is mounted. - fn on_pre_route(&mut self, _: HookContext<'_>) {} - - /// Called after a route is mounted. - fn on_post_route(&mut self, _: HookContext<'_>) {} -} +#[allow(clippy::module_name_repetitions)] +pub use asynchronous::AsyncModule; +pub use sync::Module; -- cgit v1.2.3