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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#[cfg(feature = "server")]
mod conn;
/// The `silent` library.
#[warn(missing_docs)]
mod core;
mod error;
mod handler;
mod log;
mod middleware;
mod route;
#[cfg(feature = "server")]
mod rt;
#[cfg(feature = "server")]
mod service;
#[cfg(feature = "ws")]
mod ws;

pub use crate::core::{request::Request, response::Response};
pub use crate::middleware::MiddleWareHandler;
pub use error::SilentError;
pub use error::SilentResult as Result;
pub use handler::Handler;
pub use handler::{HandlerWrapper, HandlerWrapperResponse};
pub use hyper::{header, Method, StatusCode};

pub mod prelude {
    pub use crate::core::{
        path_param::PathParam, request::Request, res_body::full, response::Response,
    };
    pub use crate::error::{SilentError, SilentResult as Result};
    #[cfg(feature = "static")]
    pub use crate::handler::static_handler;
    pub use crate::handler::Handler;
    pub use crate::handler::{HandlerWrapper, HandlerWrapperResponse};
    pub use crate::log::*;
    pub use crate::middleware::MiddleWareHandler;
    #[cfg(feature = "ws")]
    pub use crate::route::handler_append::WSHandlerAppend;
    pub use crate::route::handler_append::{HandlerAppend, HandlerGetter};
    pub use crate::route::Route;
    #[cfg(feature = "server")]
    pub use crate::service::Server;
    #[cfg(feature = "ws")]
    pub use crate::ws::{
        FnOnClose, FnOnConnect, FnOnNoneResultFut, FnOnReceive, FnOnSend, FnOnSendFut,
    };
    #[cfg(feature = "ws")]
    pub use crate::ws::{Message, WebSocket, WebSocketHandler, WebSocketParts};
    pub use hyper::{header, upgrade, Method, StatusCode};
}