fn read_to_string<'a>(&'a mut self, buf: &'a mut String) -> ReadToString<'a, Self>
    where
        Self: Unpin,
    {
        assert_future::<Result<usize>, _>(ReadToString::new(self, buf))
    }
Creates a future which will read all the bytes from this `AsyncRead`.

On success the total number of bytes read is returned.

# Examples

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

let mut reader = Cursor::new(&b"1234"[..]);
let mut buffer = String::with_capacity(4);

let bytes = reader.read_to_string(&mut buffer).await?;

assert_eq!(bytes, 4);
assert_eq!(buffer, String::from("1234"));
# Ok::<(), Box<dyn std::error::Error>>(()) }).unwrap();
```
futures-util/src/io/mod.rs