std::io::empty - Rust
Description: API documentation for the Rust `empty` fn in crate `std`.
Keywords: rust, rustlang, rust-lang, empty

# 1.0.0[−][src]Function std::io::empty

    pub fn empty() -> Empty

Constructs a new handle to an empty reader.

All reads from the returned reader will return `Ok``(0)`.

# Examples

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

    use std::io::{self, Read};

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

Run