feat(server): Make the server code an optional feature (#2334)

cc #2223 

BREAKING CHANGE: The HTTP server code is now an optional feature. To
  enable the server, add `features = ["server"]` to the dependency in
  your `Cargo.toml`.
This commit is contained in:
Sean McArthur
2020-11-18 11:02:20 -08:00
committed by GitHub
parent 4e55583d30
commit bdb5e5d694
18 changed files with 185 additions and 102 deletions

View File

@@ -68,12 +68,9 @@ pub mod rt;
pub mod service;
pub mod upgrade;
cfg_any_http! {
cfg_proto! {
mod headers;
mod proto;
pub mod server;
pub use crate::server::Server;
}
cfg_feature! {
@@ -82,3 +79,10 @@ cfg_feature! {
pub mod client;
pub use crate::client::Client;
}
cfg_feature! {
#![all(feature = "server", any(feature = "http1", feature = "http2"))]
pub mod server;
pub use crate::server::Server;
}