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

@@ -14,14 +14,16 @@ use crate::common::{task, Future, Pin, Poll};
use crate::headers::content_length_parse_all;
pub(crate) mod ping;
pub(crate) mod server;
cfg_client! {
pub(crate) mod client;
pub(crate) use self::client::ClientTask;
}
pub(crate) use self::server::Server;
cfg_server! {
pub(crate) mod server;
pub(crate) use self::server::Server;
}
/// Default initial stream window size defined in HTTP2 spec.
pub(crate) const SPEC_WINDOW_SIZE: u32 = 65_535;