more feature flgs

This commit is contained in:
Lucio Franco
2019-09-24 18:32:39 -04:00
parent a37640c282
commit 41d0f6ac5e
2 changed files with 15 additions and 7 deletions
+6 -7
View File
@@ -18,10 +18,11 @@ tokio-codec = "=0.2.0-alpha.4"
async-stream = "0.1.1" async-stream = "0.1.1"
http-body = "0.2.0-alpha.1" http-body = "0.2.0-alpha.1"
pin-project = "=0.4.0-alpha.11" pin-project = "=0.4.0-alpha.11"
async-trait = "0.1"
# optional # codegen
# hyper = { version = "=0.13.0-alpha.1", optional = true } async-trait = { version = "0.1.13", optional = true }
# transport
hyper = { git = "https://github.com/hyperium/hyper", features = ["unstable-stream"], optional = true, rev = "2b0405c48c10bca7893c30ea960ac20a41a8578f" } hyper = { git = "https://github.com/hyperium/hyper", features = ["unstable-stream"], optional = true, rev = "2b0405c48c10bca7893c30ea960ac20a41a8578f" }
tokio = { version = "=0.2.0-alpha.4", default-features = false, features = ["tcp"], optional = true } tokio = { version = "=0.2.0-alpha.4", default-features = false, features = ["tcp"], optional = true }
tower = { version = "=0.3.0-alpha.1a", optional = true} tower = { version = "=0.3.0-alpha.1a", optional = true}
@@ -38,13 +39,11 @@ openssl1 = { package = "openssl", version = "0.10", optional = true }
tokio-rustls = { version = "0.12.0-alpha.2", optional = true } tokio-rustls = { version = "0.12.0-alpha.2", optional = true }
[features] [features]
default = ["transport"] default = ["transport", "codegen"]
codegen = ["async-trait"]
transport = [ transport = [
"hyper", "hyper",
"tower-1",
"tokio", "tokio",
]
tower-1 = [
"tower", "tower",
"tower-reconnect", "tower-reconnect",
"tower-balance", "tower-balance",
+9
View File
@@ -20,6 +20,11 @@
//! //!
//! Examples can be found in the [`tonic-examples`] crate. //! Examples can be found in the [`tonic-examples`] crate.
//! //!
//! # Feature Flags
//!
//! - `transport`: Enables the fully featured, batteries included client and server
//! implementaiton based on [`hyper`], [`tower`] and [`tokio`].
//!
//! # Generic implementation //! # Generic implementation
//! //!
//! TODO: write generic implementation docs //! TODO: write generic implementation docs
@@ -45,7 +50,10 @@ mod request;
mod response; mod response;
mod status; mod status;
/// A re-export of [`async-trait`](https://docs.rs/async-trait) for use with codegen.
#[cfg(feature = "codegen")]
pub use async_trait::async_trait; pub use async_trait::async_trait;
#[doc(inline)] #[doc(inline)]
pub use codec::Streaming; pub use codec::Streaming;
pub use request::Request; pub use request::Request;
@@ -55,4 +63,5 @@ pub use status::{Code, Status};
pub(crate) type Error = Box<dyn std::error::Error + Send + Sync>; pub(crate) type Error = Box<dyn std::error::Error + Send + Sync>;
#[doc(hidden)] #[doc(hidden)]
#[cfg(feature = "codegen")]
pub mod codegen; pub mod codegen;