Skip to content

Commit

Permalink
net: add note about into_split's drop (tokio-rs#2567)
Browse files Browse the repository at this point in the history
This took me a bit to catch on to because I didn't really think there was any reason to investigate the individual documentation of each half. As someone dealing with TCP streams directly for first time (without previous experience from other languages) this caught me by surprise
  • Loading branch information
Mathspy authored and jensim committed Jun 7, 2020
1 parent 671bad8 commit 6d18230
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tokio/src/net/tcp/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,8 @@ impl TcpStream {
/// Unlike [`split`], the owned halves can be moved to separate tasks, however
/// this comes at the cost of a heap allocation.
///
/// **Note:** Dropping the write half will close the TCP stream in both directions.
///
/// [`split`]: TcpStream::split()
pub fn into_split(self) -> (OwnedReadHalf, OwnedWriteHalf) {
split_owned(self)
Expand Down

0 comments on commit 6d18230

Please sign in to comment.