Skip to content

std::io

Status: experimental

Stream-oriented I/O abstractions and process standard streams.

API details and source

The implementation source contains the complete declarations and implementation notes. The table below lists canonical Gossamer call signatures; every item name links directly to its implementation file.

Item Canonical signature or declaration Description
BufReader type BufReader Buffered wrapper around any Reader.
BufWriter type BufWriter Buffered wrapper around any Writer.
Copy fn Copy(dst: io::Writer, src: io::Reader) -> Result<i64, io::Error> Copies all bytes from src to dst; returns the byte count.
Error type Error Errors raised by I/O operations.
ReadAll fn ReadAll(reader: io::Reader) -> Result<String, io::Error> Drains a reader to a String. Mirrors Go's io.ReadAll.
Reader trait Reader Pull-style byte source.
Writer trait Writer Push-style byte sink.
stderr fn stderr() -> io::Writer Returns a handle to the process's standard error stream.
stdin fn stdin() -> io::Reader Returns a handle to the process's standard input stream. Use read_line(&mut String) for interactive prompts.
stdout fn stdout() -> io::Writer Returns a handle to the process's standard output stream.