From dedd3b7f509043bafec37b5a5b31872f15ef7723 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Thu, 3 Jun 2021 09:52:06 -0700 Subject: [PATCH 1/2] Document the typical value for an `io` param Per https://github.com/rust-lang/rust/issues/84824, it can be hard to figure out from the trait bounds what types meet those bounds. --- src/client/conn.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/conn.rs b/src/client/conn.rs index 70c1dad248..731b4680d8 100644 --- a/src/client/conn.rs +++ b/src/client/conn.rs @@ -87,7 +87,8 @@ where H2(#[pin] proto::h2::ClientTask, PhantomData), } -/// Returns a handshake future over some IO. +/// Returns a handshake future over some IO. The io parameter will usually be a +/// [tokio::net::TcpStream](https://docs.rs/tokio/1.6.1/tokio/net/struct.TcpStream.html). /// /// This is a shortcut for `Builder::new().handshake(io)`. pub async fn handshake( @@ -106,6 +107,9 @@ pub struct SendRequest { /// A future that processes all HTTP state for the IO object. /// +/// The io parameter will usually be a +/// [tokio::net::TcpStream](https://docs.rs/tokio/1.6.1/tokio/net/struct.TcpStream.html). +/// /// In most cases, this should just be spawned into an executor, so that it /// can process incoming and outgoing messages, notice hangups, and the like. #[must_use = "futures do nothing unless polled"] From ba2f4de55afd0aa2943c6b84c9e4eeb4613a7ba3 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Wed, 20 Oct 2021 10:14:28 -0700 Subject: [PATCH 2/2] Review feedback --- src/client/conn.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/conn.rs b/src/client/conn.rs index 731b4680d8..63bd21ba99 100644 --- a/src/client/conn.rs +++ b/src/client/conn.rs @@ -87,8 +87,10 @@ where H2(#[pin] proto::h2::ClientTask, PhantomData), } -/// Returns a handshake future over some IO. The io parameter will usually be a -/// [tokio::net::TcpStream](https://docs.rs/tokio/1.6.1/tokio/net/struct.TcpStream.html). +/// Returns a handshake future over some IO. +/// +/// The io parameter will usually be a +/// [tokio::net::TcpStream](https://docs.rs/tokio/latest/tokio/net/struct.TcpStream.html). /// /// This is a shortcut for `Builder::new().handshake(io)`. pub async fn handshake( @@ -108,7 +110,7 @@ pub struct SendRequest { /// A future that processes all HTTP state for the IO object. /// /// The io parameter will usually be a -/// [tokio::net::TcpStream](https://docs.rs/tokio/1.6.1/tokio/net/struct.TcpStream.html). +/// [tokio::net::TcpStream](https://docs.rs/tokio/latest/tokio/net/struct.TcpStream.html). /// /// In most cases, this should just be spawned into an executor, so that it /// can process incoming and outgoing messages, notice hangups, and the like.