[][src]Function tokio::io::empty

pub fn empty() -> Empty
This is supported on feature="io-util" only.

Creates a new empty async reader.

All reads from the returned reader will return Poll::Ready(Ok(0)).

This is an asynchronous version of std::io::empty.

Examples

A slightly sad example of not reading anything into a buffer:

let mut buffer = String::new();
io::empty().read_to_string(&mut buffer).await.unwrap();
assert!(buffer.is_empty());