apalis_board_api/framework/
mod.rs1#[cfg(feature = "actix")]
2pub mod actix;
3#[cfg(feature = "axum")]
4pub mod axum;
5
6pub trait RegisterRoute<B, T> {
7 fn register(self, backend: B) -> Self;
8}
9
10pub struct ApiBuilder<R> {
11 router: R,
12 #[allow(dead_code)]
13 root: bool,
14}
15
16impl<R> ApiBuilder<R> {
17 pub fn new(router: R) -> Self {
19 Self { router, root: true }
20 }
21 pub fn new_with_router(router: R, register_root: bool) -> Self {
25 Self {
26 router,
27 root: register_root,
28 }
29 }
30
31 pub fn build(self) -> R {
33 self.router
34 }
35}