use read;usestd::io::{self, BufReader, Stdin};/// `FromStdin` wraps a buffered `Stdin`.
////// `FromStdin` provides an iterator over lines found in the input stream or,
/// alternatively, a method providing access to the whole stream as a single
/// string.
pubstructFromStdin(BufReader<Stdin>);implFromStdin{/// Creates a new instance of FromStdin.
pubfnnew()-> FromStdin{
FromStdin(BufReader::new(io::stdin()))}/// Reads the entire contents of the standard input stream into a string.
pubfnall(&mutself)-> String{read::whole_stream(&mutself.0)}}implDefault forFromStdin{fndefault()-> FromStdin{FromStdin::new()}}implIterator forFromStdin{typeItem=String;fnnext(&mutself)->Option<Self::Item>{read::next_line(&mutself.0)}}