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

io: flush in AsyncWriteExt examples #6149

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions tokio/src/io/util/async_write_ext.rs
Expand Up @@ -117,6 +117,7 @@ cfg_io_util! {
///
/// // Writes some prefix of the byte string, not necessarily all of it.
/// file.write(b"some bytes").await?;
/// file.flush().await?;
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -162,6 +163,7 @@ cfg_io_util! {
/// ];
///
/// file.write_vectored(&bufs).await?;
/// file.flush().await?;
///
/// Ok(())
/// }
Expand Down Expand Up @@ -244,6 +246,7 @@ cfg_io_util! {
/// // all of it.
/// file.write_buf(&mut buffer).await?;
/// }
/// file.flush().await?;
///
/// Ok(())
/// }
Expand Down Expand Up @@ -307,6 +310,7 @@ cfg_io_util! {
/// let mut buffer = Cursor::new(b"data to write");
///
/// file.write_all_buf(&mut buffer).await?;
/// file.flush().await?;
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -356,6 +360,7 @@ cfg_io_util! {
/// let mut file = File::create("foo.txt").await?;
///
/// file.write_all(b"some bytes").await?;
/// file.flush().await?;
/// Ok(())
/// }
/// ```
Expand Down