1use std::future::Future;
9use std::net::SocketAddr;
10use std::pin::Pin;
11
12mod adapters;
13mod app;
14mod error;
15mod http;
16mod module;
17mod percent;
18mod pipeline;
19mod provider;
20mod routing;
21
22#[cfg(feature = "macros")]
23pub use a3s_boot_macros::{
24 controller, delete, delete_json, get, get_json, head, injectable, options, patch, patch_json,
25 post, post_json, put, put_json, sse,
26};
27#[cfg(feature = "axum")]
28pub use adapters::AxumAdapter;
29pub use app::{BootApplication, BootApplicationBuilder, RouteMatch};
30pub use error::BootError;
31pub use http::{BootRequest, BootResponse, HttpMethod, SseEvent, SseStream};
32pub use module::Module;
33pub use pipeline::{ExceptionFilter, ExecutionContext, Guard, Interceptor, Pipe};
34pub use provider::{ModuleRef, ProviderDefinition, ProviderToken};
35pub use routing::{ControllerDefinition, RouteDefinition, RouteHandler};
36
37pub type Result<T> = std::result::Result<T, BootError>;
39
40pub type BoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
42
43pub trait HttpAdapter {
45 type Output;
46
47 fn build(&self, app: BootApplication) -> Result<Self::Output>;
48
49 fn serve(&self, app: BootApplication, addr: SocketAddr) -> BoxFuture<'static, Result<()>>;
50}