Files
base64
bitflags
bytes
cfg_if
dtoa
encoding_rs
fnv
foreign_types
foreign_types_shared
futures
futures_channel
futures_core
futures_executor
futures_io
futures_macro
futures_sink
futures_task
futures_util
async_await
future
io
lock
sink
stream
task
goauth
h2
hashbrown
http
http_body
httparse
hyper
hyper_tls
idna
indexmap
iovec
itoa
lazy_static
libc
log
matches
memchr
mime
mime_guess
mio
native_tls
net2
num_cpus
once_cell
openssl
openssl_probe
openssl_sys
percent_encoding
pin_project
pin_project_internal
pin_project_lite
pin_utils
proc_macro2
proc_macro_hack
proc_macro_nested
quote
reqwest
ryu
serde
serde_derive
serde_json
serde_urlencoded
simpl
slab
smpl_jwt
socket2
standback
syn
time
time_macros
time_macros_impl
tinyvec
tokio
future
io
loom
macros
net
park
runtime
stream
sync
task
time
util
tokio_tls
tokio_util
tower_service
tracing
tracing_core
try_lock
unicase
unicode_bidi
unicode_normalization
unicode_xid
url
want
 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
//! Asynchronous Services
//!
//! A [`Service`](Service) is a trait representing an asynchronous
//! function of a request to a response. It's similar to
//! `async fn(Request) -> Result<Response, Error>`.
//!
//! The argument and return value isn't strictly required to be for HTTP.
//! Therefore, hyper uses several "trait aliases" to reduce clutter around
//! bounds. These are:
//!
//! - `HttpService`: This is blanketly implemented for all types that
//!   implement `Service<http::Request<B1>, Response = http::Response<B2>>`.
//! - `MakeService`: When a `Service` returns a new `Service` as its "response",
//!   we consider it a `MakeService`. Again, blanketly implemented in those cases.
//! - `MakeConnection`: A `Service` that returns a "connection", a type that
//!   implements `AsyncRead` and `AsyncWrite`.
//!
//! # HttpService
//!
//! In hyper, especially in the server setting, a `Service` is usually bound
//! to a single connection. It defines how to respond to **all** requests that
//! connection will receive.
//!
//! The helper [`service_fn`](service_fn) should be sufficient for most cases, but
//! if you need to implement `Service` for a type manually, you can follow the example
//! in `service_struct_impl.rs`.
//!
//! # MakeService
//!
//! Since a `Service` is bound to a single connection, a [`Server`](crate::Server)
//! needs a way to make them as it accepts connections. This is what a
//! `MakeService` does.
//!
//! Resources that need to be shared by all `Service`s can be put into a
//! `MakeService`, and then passed to individual `Service`s when `call`
//! is called.

pub use tower_service::Service;

mod http;
mod make;
mod oneshot;
mod util;

pub(crate) use self::http::HttpService;
pub(crate) use self::make::{MakeConnection, MakeServiceRef};
pub(crate) use self::oneshot::{oneshot, Oneshot};

pub use self::make::make_service_fn;
pub use self::util::service_fn;