aboutsummaryrefslogtreecommitdiff
path: root/src/module.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-04-04 09:33:14 +0000
committerFuwn <[email protected]>2023-04-04 09:33:14 +0000
commita6a61d5be2d508caf145e7d33fcbbd173fa8a356 (patch)
treeb2d1ffd50774960a6297bb88c999d5e9ea8a668f /src/module.rs
parentfeat(route): native async route support !! (diff)
downloadwindmark-a6a61d5be2d508caf145e7d33fcbbd173fa8a356.tar.xz
windmark-a6a61d5be2d508caf145e7d33fcbbd173fa8a356.zip
feat(module): async module support
Diffstat (limited to 'src/module.rs')
-rw-r--r--src/module.rs16
1 files changed, 5 insertions, 11 deletions
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 <[email protected]>
// 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;