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
51
52
53
54
55
56
57
58
59
60
61
62
63
pub extern crate hyper;
pub extern crate futures;
extern crate futures_cpupool;
extern crate unsafe_any as uany;
extern crate ferrum_plugin as plugin;
extern crate num_cpus;
extern crate mime_guess;
pub extern crate mime;
pub extern crate url;

/// Request + Response
pub use request::Request;
pub use response::Response;

/// Middleware system
pub use middleware::{BeforeMiddleware, AfterMiddleware, AroundMiddleware, Handler, Chain};

/// Server
pub use ferrum::*;

/// Extensions
pub use typemap::TypeMap;

/// Headers
pub use hyper::header;
pub use hyper::header::Headers;
pub use hyper::header::Header;

/// Status Codes
pub use hyper::{Method, StatusCode, Uri};

/// Expose `Pluggable` as `Plugin` so users can do `use ferrum::Plugin`.
pub use plugin::Pluggable as Plugin;

/// Errors
pub use error::Error;
pub use error::FerrumError;

/// Ferrum's error type and associated utilities.
pub mod error;

/// The Result alias used throughout Ferrum and in clients of Ferrum.
pub type FerrumResult<T> = Result<T, FerrumError>;

/// Re-exports from the `TypeMap` crate.
pub mod typemap {
    pub use plugin::typemap::{TypeMap, Key};
    pub use uany::UnsafeAny;
    pub type TypeMapInner = UnsafeAny + Send + Sync;
}

// Publicized to show the documentation
pub mod middleware;

/// Request utilities
pub mod request;

/// Response utilities
pub mod response;

pub mod service;

mod ferrum;