fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, Self>
    where
        Self: Unpin,
    {
        assert_future::<Result<()>, _>(WriteAll::new(self, buf))
    }
Write data into this object.

Creates a future that will write the entire contents of the buffer `buf` into
this `AsyncWrite`.

The returned future will not complete until all the data has been written.

# Examples

```
# futures::executor::block_on(async {
use futures::io::{AsyncWriteExt, Cursor};

let mut writer = Cursor::new(vec![0u8; 5]);

writer.write_all(&[1, 2, 3, 4]).await?;

assert_eq!(writer.into_inner(), [1, 2, 3, 4, 0]);
# Ok::<(), Box<dyn std::error::Error>>(()) }).unwrap();
```
futures-util/src/io/mod.rs