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
mod router;
mod handler;
mod response;
mod request;
mod interface;
mod params;
mod file;
mod error;
mod middleware;

pub(crate) use file::{FilePart,FormData};
pub(crate) use handler::Handler;
pub(crate) use hyper::http::Method;
pub(crate) use response::IntoResponse;
pub(crate) use router::Router;
pub use error::Error;
pub use interface::HTTP;
pub use middleware::{Middleware, Next};
pub use hyper::http::StatusCode;

#[macro_use]
extern crate async_trait;

#[derive(Debug)]
pub struct Request(hyper::http::Request<hyper::Body>);
#[derive(Debug)]
pub struct Response(hyper::http::Response<hyper::Body>);
pub type Result<T, E = anyhow::Error> = core::result::Result<T, E>;

pub fn new() -> Router {
    Router::default()
}