Skip to content
CryoCryo home
StdlibSystem

io

Every byte source implements Read and every byte sink implements Write. Because both traits carry substantial defaults, an implementation only has to supply one method to get the whole convenience surface — read_line, read_to_string, write, and the rest — for free. IoError is the failure channel throughout.

public module io::error;
public module io::fd;
public module io::traits;
public module io::stdio;
public module io::buf;
public module io::cursor;
FileWhat it holdsImport
traitsRead, Write, Seek, and the async AsyncRead / AsyncWrite / AsyncTransportimport std::io::traits;
stdioStdin, Stdout, Stderr and their lock guardsimport std::io::stdio;
bufBufReader, BufWriter, LineWriter, and the async BufStreamimport std::io::buf;
cursorCursor, an in-memory Read + Write + Seekimport std::io::cursor;
errorIoError, IoErrorKind, the errno constantsimport std::io::error;
fdread_fd, write_fd, close_fdimport std::io::fd;

There is no buffering by default anywhere in this module: the standard streams and File translate to raw read(2) / write(2) calls. Compose it explicitly with the adapters in buf when you want it.