more feature flgs
This commit is contained in:
+6
-7
@@ -18,10 +18,11 @@ tokio-codec = "=0.2.0-alpha.4"
|
||||
async-stream = "0.1.1"
|
||||
http-body = "0.2.0-alpha.1"
|
||||
pin-project = "=0.4.0-alpha.11"
|
||||
async-trait = "0.1"
|
||||
|
||||
# optional
|
||||
# hyper = { version = "=0.13.0-alpha.1", optional = true }
|
||||
# codegen
|
||||
async-trait = { version = "0.1.13", optional = true }
|
||||
|
||||
# transport
|
||||
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 }
|
||||
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 }
|
||||
|
||||
[features]
|
||||
default = ["transport"]
|
||||
default = ["transport", "codegen"]
|
||||
codegen = ["async-trait"]
|
||||
transport = [
|
||||
"hyper",
|
||||
"tower-1",
|
||||
"tokio",
|
||||
]
|
||||
tower-1 = [
|
||||
"tower",
|
||||
"tower-reconnect",
|
||||
"tower-balance",
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
//!
|
||||
//! 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
|
||||
//!
|
||||
//! TODO: write generic implementation docs
|
||||
@@ -45,7 +50,10 @@ mod request;
|
||||
mod response;
|
||||
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;
|
||||
|
||||
#[doc(inline)]
|
||||
pub use codec::Streaming;
|
||||
pub use request::Request;
|
||||
@@ -55,4 +63,5 @@ pub use status::{Code, Status};
|
||||
pub(crate) type Error = Box<dyn std::error::Error + Send + Sync>;
|
||||
|
||||
#[doc(hidden)]
|
||||
#[cfg(feature = "codegen")]
|
||||
pub mod codegen;
|
||||
|
||||
Reference in New Issue
Block a user