chore(tonic): Remove duplicate tls feature gate and re-export http crate instead of using wildcard importing (#1281)
* chore(tonic): Remove duplicate tls feature gate * chore(tonic): Re export http crate instead of using wildcard importing
This commit is contained in:
@@ -13,14 +13,11 @@ pub type StdError = Box<dyn std::error::Error + Send + Sync + 'static>;
|
|||||||
pub use crate::codec::{CompressionEncoding, EnabledCompressionEncodings};
|
pub use crate::codec::{CompressionEncoding, EnabledCompressionEncodings};
|
||||||
pub use crate::service::interceptor::InterceptedService;
|
pub use crate::service::interceptor::InterceptedService;
|
||||||
pub use bytes::Bytes;
|
pub use bytes::Bytes;
|
||||||
|
pub use http;
|
||||||
pub use http_body::Body;
|
pub use http_body::Body;
|
||||||
|
|
||||||
pub type BoxFuture<T, E> = self::Pin<Box<dyn self::Future<Output = Result<T, E>> + Send + 'static>>;
|
pub type BoxFuture<T, E> = self::Pin<Box<dyn self::Future<Output = Result<T, E>> + Send + 'static>>;
|
||||||
pub type BoxStream<T> =
|
pub type BoxStream<T> =
|
||||||
self::Pin<Box<dyn futures_core::Stream<Item = Result<T, crate::Status>> + Send + 'static>>;
|
self::Pin<Box<dyn futures_core::Stream<Item = Result<T, crate::Status>> + Send + 'static>>;
|
||||||
|
|
||||||
pub mod http {
|
|
||||||
pub use http::*;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub use crate::body::empty_body;
|
pub use crate::body::empty_body;
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ use http::Uri;
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// Configures TLS settings for endpoints.
|
/// Configures TLS settings for endpoints.
|
||||||
#[cfg(feature = "tls")]
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
pub struct ClientTlsConfig {
|
pub struct ClientTlsConfig {
|
||||||
domain: Option<String>,
|
domain: Option<String>,
|
||||||
@@ -16,7 +14,6 @@ pub struct ClientTlsConfig {
|
|||||||
identity: Option<Identity>,
|
identity: Option<Identity>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "tls")]
|
|
||||||
impl fmt::Debug for ClientTlsConfig {
|
impl fmt::Debug for ClientTlsConfig {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("ClientTlsConfig")
|
f.debug_struct("ClientTlsConfig")
|
||||||
@@ -27,7 +24,6 @@ impl fmt::Debug for ClientTlsConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "tls")]
|
|
||||||
impl ClientTlsConfig {
|
impl ClientTlsConfig {
|
||||||
/// Creates a new `ClientTlsConfig` using Rustls.
|
/// Creates a new `ClientTlsConfig` using Rustls.
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ use crate::transport::{
|
|||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
/// Configures TLS settings for servers.
|
/// Configures TLS settings for servers.
|
||||||
#[cfg(feature = "tls")]
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "tls")))]
|
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Default)]
|
||||||
pub struct ServerTlsConfig {
|
pub struct ServerTlsConfig {
|
||||||
identity: Option<Identity>,
|
identity: Option<Identity>,
|
||||||
@@ -14,14 +12,12 @@ pub struct ServerTlsConfig {
|
|||||||
client_auth_optional: bool,
|
client_auth_optional: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "tls")]
|
|
||||||
impl fmt::Debug for ServerTlsConfig {
|
impl fmt::Debug for ServerTlsConfig {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("ServerTlsConfig").finish()
|
f.debug_struct("ServerTlsConfig").finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "tls")]
|
|
||||||
impl ServerTlsConfig {
|
impl ServerTlsConfig {
|
||||||
/// Creates a new `ServerTlsConfig`.
|
/// Creates a new `ServerTlsConfig`.
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user