ayun_server/
lib.rs

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
29
30
31
32
#[cfg(feature = "config")]
pub mod config;
pub mod errors;
pub mod middleware;
pub mod request;
pub mod response;
pub mod router;
#[cfg(any(feature = "http1", feature = "http2"))]
mod service;
pub mod traits;

pub type Error = errors::Error;

pub type Result<T, E = Error> = ayun_core::Result<T, E>;

pub type Request = axum::extract::Request;

pub type Response = Result<axum::response::Response, Error>;

pub type Middleware = ayun_core::BoxCallback<axum::Router, Result<axum::Router>>;

#[allow(dead_code)]
#[derive(Clone, Default)]
pub struct Server {
    inner: axum::Router,
}

impl From<Server> for axum::Router {
    fn from(value: Server) -> Self {
        value.inner
    }
}