1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
pub mod middleware;
pub mod proxies;
pub mod servers;
pub mod signals;
use scsys::prelude::{AsyncResult, Contextual};
use servers::ServerSpec;
#[async_trait::async_trait]
pub trait WebBackend {
type Ctx: Contextual;
type Server: ServerSpec + Send + Sync;
async fn client(&self) -> axum::Router;
fn context(&self) -> Self::Ctx;
fn server(&self) -> Self::Server;
async fn serve(&self) -> AsyncResult {
self.server().serve(self.client().await).await
}
}