fn flush(&mut self) -> Flush<'_, Self>
    where
        Self: Unpin,
    {
        assert_future::<Result<()>, _>(Flush::new(self))
    }
/// Creates a future which will entirely flush this `AsyncWrite`.
///
/// # Examples
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::io::{AllowStdIo, AsyncWriteExt};
/// use std::io::{BufWriter, Cursor};
///
/// let mut output = vec![0u8; 5];
///
/// {
///     let writer = Cursor::new(&mut output);
///     let mut buffered = AllowStdIo::new(BufWriter::new(writer));
///     buffered.write_all(&[1, 2]).await?;
///     buffered.write_all(&[3, 4]).await?;
///     buffered.flush().await?;
/// }
///
/// assert_eq!(output, [1, 2, 3, 4, 0]);
/// # Ok::<(), Box<dyn std::error::Error>>(()) }).unwrap();
/// ```
Creates a future which will entirely flush this `AsyncWrite`.
Creates a future which will entirely flush this ` AsyncWrite ` .
fn flush(&mut self) -> Flush<'_, Self>
    where
        Self: Unpin,
    {
        assert_future::<Result<()>, _>(Flush::new(self))
    }
fn flush ( & mut self ) -> Flush < ' _ , Self > where Self : Unpin , { assert_future :: < Result < ( ) > , _ > ( Flush :: new ( self ) ) }
Creates a future which will entirely flush this `AsyncWrite`.
Creates a future which will entirely flush this ` AsyncWrite ` .
&mut self
&mut self
examples
None
futures::executor::block_on(async {
use futures::io::{AllowStdIo, AsyncWriteExt};
use std::io::{BufWriter, Cursor}.



{
let writer = Cursor::new(&mut output);
let mut buffered = AllowStdIo::new(BufWriter::new(writer));
buffered.write_all(&[1, 2]).await?;
buffered.write_all(&[3, 4]).await?;
buffered.flush().await?;
}


use futures :: io :: { AllowStdIo AsyncWriteExt } ; use std :: io :: { BufWriter Cursor } . { let writer = Cursor :: new ( &mut output ) ; let mut buffered = AllowStdIo :: new ( BufWriter :: new ( writer )) ; buffered . write_all ( & [ 1 2 ] ) . await? ; buffered . write_all ( & [ 3 4 ] ) . await? ; buffered . flush () . await? ; }
ok::<(), box<dyn std::error::error>>(()) }).unwrap();
None