Skip to content

Commit 897dc05

Browse files
Merge branch 'tokio-rs:master' into master
2 parents 6ab44b9 + d3fe355 commit 897dc05

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tokio-util/src/io/reader_stream.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ impl<R: AsyncRead> ReaderStream<R> {
5858
/// Convert an [`AsyncRead`] into a [`Stream`] with item type
5959
/// `Result<Bytes, std::io::Error>`.
6060
///
61+
/// Currently, the default capacity 4096 bytes (4 KiB).
62+
/// This capacity is not part of the semver contract
63+
/// and may be tweaked in future releases without
64+
/// requiring a major version bump.
65+
///
6166
/// [`AsyncRead`]: tokio::io::AsyncRead
6267
/// [`Stream`]: futures_core::Stream
6368
pub fn new(reader: R) -> Self {

tokio/src/net/tcp/stream.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,13 @@ impl TcpStream {
10701070
/// Successive calls return the same data. This is accomplished by passing
10711071
/// `MSG_PEEK` as a flag to the underlying `recv` system call.
10721072
///
1073+
/// # Cancel safety
1074+
///
1075+
/// This method is cancel safe. If the method is used as the event in a
1076+
/// [`tokio::select!`](crate::select) statement and some other branch
1077+
/// completes first, then it is guaranteed that no peek was performed, and
1078+
/// that `buf` has not been modified.
1079+
///
10731080
/// # Examples
10741081
///
10751082
/// ```no_run

0 commit comments

Comments
 (0)