diff --git a/src/client/conn/http2.rs b/src/client/conn/http2.rs index f4cdcd5e9f..4153ec044e 100644 --- a/src/client/conn/http2.rs +++ b/src/client/conn/http2.rs @@ -16,7 +16,7 @@ use super::super::dispatch; use crate::body::{Body, Incoming as IncomingBody}; use crate::common::time::Time; use crate::proto; -use crate::rt::bounds::ExecutorClient; +use crate::rt::bounds::Http2ClientConnExec; use crate::rt::Timer; /// The sender side of an established connection. @@ -41,7 +41,7 @@ pub struct Connection where T: Read + Write + 'static + Unpin, B: Body + 'static, - E: ExecutorClient + Unpin, + E: Http2ClientConnExec + Unpin, B::Error: Into>, { inner: (PhantomData, proto::h2::ClientTask), @@ -73,7 +73,7 @@ where B: Body + 'static, B::Data: Send, B::Error: Into>, - E: ExecutorClient + Unpin + Clone, + E: Http2ClientConnExec + Unpin + Clone, { Builder::new(exec).handshake(io).await } @@ -202,7 +202,7 @@ where B: Body + Unpin + 'static, B::Data: Send, B::Error: Into>, - E: ExecutorClient + Unpin, + E: Http2ClientConnExec + Unpin, { /// Returns whether the [extended CONNECT protocol][1] is enabled or not. /// @@ -222,7 +222,7 @@ impl fmt::Debug for Connection where T: Read + Write + fmt::Debug + 'static + Unpin, B: Body + 'static, - E: ExecutorClient + Unpin, + E: Http2ClientConnExec + Unpin, B::Error: Into>, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -237,7 +237,7 @@ where B::Data: Send, E: Unpin, B::Error: Into>, - E: ExecutorClient + 'static + Send + Sync + Unpin, + E: Http2ClientConnExec + 'static + Send + Sync + Unpin, { type Output = crate::Result<()>; @@ -407,7 +407,7 @@ where B: Body + 'static, B::Data: Send, B::Error: Into>, - Ex: ExecutorClient + Unpin, + Ex: Http2ClientConnExec + Unpin, { let opts = self.clone(); diff --git a/src/proto/h2/client.rs b/src/proto/h2/client.rs index f5104f1f66..3dd5467120 100644 --- a/src/proto/h2/client.rs +++ b/src/proto/h2/client.rs @@ -28,7 +28,7 @@ use crate::ext::Protocol; use crate::headers; use crate::proto::h2::UpgradedSendStream; use crate::proto::Dispatched; -use crate::rt::bounds::ExecutorClient; +use crate::rt::bounds::Http2ClientConnExec; use crate::upgrade::Upgraded; use crate::{Request, Response}; use h2::client::ResponseFuture; @@ -118,7 +118,7 @@ where T: Read + Write + Unpin + 'static, B: Body + 'static, B::Data: Send + 'static, - E: ExecutorClient + Unpin, + E: Http2ClientConnExec + Unpin, B::Error: Into>, { let (h2_tx, mut conn) = new_builder(config) @@ -405,7 +405,7 @@ where impl ClientTask where B: Body + 'static, - E: ExecutorClient + Unpin, + E: Http2ClientConnExec + Unpin, B::Error: Into>, T: Read + Write + Unpin, { @@ -457,7 +457,7 @@ impl ClientTask where B: Body + 'static + Unpin, B::Data: Send, - E: ExecutorClient + Unpin, + E: Http2ClientConnExec + Unpin, B::Error: Into>, T: Read + Write + Unpin, { @@ -593,7 +593,7 @@ where B: Body + 'static + Unpin, B::Data: Send, B::Error: Into>, - E: ExecutorClient + 'static + Send + Sync + Unpin, + E: Http2ClientConnExec + 'static + Send + Sync + Unpin, T: Read + Write + Unpin, { type Output = crate::Result; diff --git a/src/proto/h2/server.rs b/src/proto/h2/server.rs index 0c6c1472a2..33f76344cc 100644 --- a/src/proto/h2/server.rs +++ b/src/proto/h2/server.rs @@ -21,7 +21,7 @@ use crate::headers; use crate::proto::h2::ping::Recorder; use crate::proto::h2::{H2Upgraded, UpgradedSendStream}; use crate::proto::Dispatched; -use crate::rt::bounds::Http2ConnExec; +use crate::rt::bounds::Http2ServerConnExec; use crate::rt::{Read, Write}; use crate::service::HttpService; @@ -112,7 +112,7 @@ where S: HttpService, S::Error: Into>, B: Body + 'static, - E: Http2ConnExec, + E: Http2ServerConnExec, { pub(crate) fn new( io: T, @@ -188,7 +188,7 @@ where S: HttpService, S::Error: Into>, B: Body + 'static, - E: Http2ConnExec, + E: Http2ServerConnExec, { type Output = crate::Result; @@ -242,7 +242,7 @@ where where S: HttpService, S::Error: Into>, - E: Http2ConnExec, + E: Http2ServerConnExec, { if self.closing.is_none() { loop { diff --git a/src/rt/bounds.rs b/src/rt/bounds.rs index 36f3683ead..aa3075e079 100644 --- a/src/rt/bounds.rs +++ b/src/rt/bounds.rs @@ -4,13 +4,13 @@ //! implemented by implementing another trait. #[cfg(all(feature = "server", feature = "http2"))] -pub use self::h2::Http2ConnExec; +pub use self::h2::Http2ServerConnExec; #[cfg(all(feature = "client", feature = "http2"))] -pub use self::h2_client::ExecutorClient; +pub use self::h2_client::Http2ClientConnExec; #[cfg(all(feature = "client", feature = "http2"))] -#[cfg_attr(docsrs, doc(cfg(all(feature = "server", feature = "http2"))))] +#[cfg_attr(docsrs, doc(cfg(all(feature = "client", feature = "http2"))))] mod h2_client { use std::{error::Error, future::Future}; @@ -25,7 +25,7 @@ mod h2_client { /// This trait is sealed and cannot be implemented for types outside this crate. /// /// [`Executor`]: crate::rt::Executor - pub trait ExecutorClient: sealed_client::Sealed<(B, T)> + pub trait Http2ClientConnExec: sealed_client::Sealed<(B, T)> where B: http_body::Body, B::Error: Into>, @@ -35,7 +35,7 @@ mod h2_client { fn execute_h2_future(&mut self, future: H2ClientFuture); } - impl ExecutorClient for E + impl Http2ClientConnExec for E where E: Executor>, B: http_body::Body + 'static, @@ -78,13 +78,13 @@ mod h2 { /// This trait is sealed and cannot be implemented for types outside this crate. /// /// [`Executor`]: crate::rt::Executor - pub trait Http2ConnExec: sealed::Sealed<(F, B)> + Clone { + pub trait Http2ServerConnExec: sealed::Sealed<(F, B)> + Clone { #[doc(hidden)] fn execute_h2stream(&mut self, fut: H2Stream); } #[doc(hidden)] - impl Http2ConnExec for E + impl Http2ServerConnExec for E where E: Executor> + Clone, H2Stream: Future, diff --git a/src/server/conn/http2.rs b/src/server/conn/http2.rs index d35f2df354..a8bf7a7faf 100644 --- a/src/server/conn/http2.rs +++ b/src/server/conn/http2.rs @@ -14,7 +14,7 @@ use pin_project_lite::pin_project; use crate::body::{Body, Incoming as IncomingBody}; use crate::proto; -use crate::rt::bounds::Http2ConnExec; +use crate::rt::bounds::Http2ServerConnExec; use crate::service::HttpService; use crate::{common::time::Time, rt::Timer}; @@ -63,7 +63,7 @@ where I: Read + Write + Unpin, B: Body + 'static, B::Error: Into>, - E: Http2ConnExec, + E: Http2ServerConnExec, { /// Start a graceful shutdown process for this connection. /// @@ -87,7 +87,7 @@ where I: Read + Write + Unpin + 'static, B: Body + 'static, B::Error: Into>, - E: Http2ConnExec, + E: Http2ServerConnExec, { type Output = crate::Result<()>; @@ -109,9 +109,9 @@ impl Builder { /// Create a new connection builder. /// /// This starts with the default options, and an executor which is a type - /// that implements [`Http2ConnExec`] trait. + /// that implements [`Http2ServerConnExec`] trait. /// - /// [`Http2ConnExec`]: crate::rt::bounds::Http2ConnExec + /// [`Http2ServerConnExec`]: crate::rt::bounds::Http2ServerConnExec pub fn new(exec: E) -> Self { Self { exec: exec, @@ -262,7 +262,7 @@ impl Builder { Bd: Body + 'static, Bd::Error: Into>, I: Read + Write + Unpin, - E: Http2ConnExec, + E: Http2ServerConnExec, { let proto = proto::h2::Server::new( io,