Skip to content

Commit

Permalink
io: document cancel safety of AsyncBufReadExt::fill_buf (#6431)
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej committed Mar 26, 2024
1 parent 4601c84 commit e542501
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tokio/src/io/util/async_buf_read_ext.rs
Expand Up @@ -267,6 +267,12 @@ cfg_io_util! {
/// This function will return an I/O error if the underlying reader was
/// read, but returned an error.
///
/// # Cancel safety
///
/// This method is cancel safe. If you use it as the event in a
/// [`tokio::select!`](crate::select) statement and some other branch
/// completes first, then it is guaranteed that no data was read.
///
/// [`consume`]: crate::io::AsyncBufReadExt::consume
fn fill_buf(&mut self) -> FillBuf<'_, Self>
where
Expand Down

0 comments on commit e542501

Please sign in to comment.