fn write<'a>(&'a mut self, buf: &'a [u8]) -> Write<'a, Self>
    where
        Self: Unpin,
    {
        assert_future::<Result<usize>, _>(Write::new(self, buf))
    }
Creates a future which will write bytes from `buf` into the object.

The returned future will resolve to the number of bytes written once the write
operation is completed.
futures-util/src/io/mod.rs