Skip to content

Commit 7e1f56f

Browse files
committed
docs: add cancel safety section to TcpStream::peek
Fix #7303
1 parent 48ca254 commit 7e1f56f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tokio/src/net/tcp/stream.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,10 @@ 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, as no underlying state gets modified.
1076+
///
10731077
/// # Examples
10741078
///
10751079
/// ```no_run

0 commit comments

Comments
 (0)