Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the typical value for an io param #2568

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/client/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ where
H2(#[pin] proto::h2::ClientTask<B>, PhantomData<fn(T)>),
}

/// 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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder, so as to not encode the version directly into the source, can we just point at (tokio::net::TcpStream)? Also, I'd put the second sentence in a new line / new paragraph.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I tried just pointing at tokio::net::TcpStream with intradoc links, but it didn't work because that's behind a feature flag. Instead I replaced 1.6.1 with latest

///
/// This is a shortcut for `Builder::new().handshake(io)`.
pub async fn handshake<T>(
Expand All @@ -106,6 +107,9 @@ pub struct SendRequest<B> {

/// 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"]
Expand Down