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();
```
futures-util/src/io/mod.rs