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
#[macro_use]
extern crate error_chain;
extern crate futures;
extern crate hyper;
#[cfg(feature = "handler")]
extern crate luminal_handler;
mod error;
mod route;
mod tree;
#[cfg(feature = "handler")]
mod handler;
#[cfg(not(feature = "handler"))]
mod service;
use futures::future::Future;
use hyper::server::Response;
#[cfg(not(feature = "handler"))]
use hyper::server::{Request, Service};
#[cfg(feature = "handler")]
pub use handler::{FnRouteBuilder, HandlerRouteBuilder, Router};
#[cfg(not(feature = "handler"))]
pub use service::{FnRouteBuilder, Router, ServiceRouteBuilder};
pub type ServiceFuture = Box<Future<Item = Response, Error = hyper::Error>>;
#[cfg(not(feature = "handler"))]
type LuminalService =
Service<Request = Request, Response = Response, Error = hyper::Error, Future = ServiceFuture>;