Expand description
Types which can be used to tune the behavior of BufReader and BufWriter.
Some simple policies are provided for your convenience. You may prefer to create your own types and implement the traits for them instead.
Structs§
- DoRead
- Flag for
ReaderPolicymethods to signal whether or notBufReadershould read into the buffer. - Flush
Amt - Flag for
WriterPolicymethods to tellBufWriterhow many bytes to flush to the underlying reader. - Flush
AtLeast - Flush the buffer if it contains at least the given number of bytes.
- Flush
Exact - Only ever flush exactly the given number of bytes, until the writer is empty.
- FlushOn
- Flush the buffer if it contains the given byte.
- Flush
OnNewline - Flush the buffer if it contains a newline (
\n). - MinBuffered
- A policy for
BufReaderwhich ensures there is at least the given number of bytes in the buffer, failing this only if the reader is at EOF. - StdPolicy
- Default policy for both
BufReaderandBufWriterthat reproduces the behaviors of theirstd::iocounterparts:
Traits§
- Reader
Policy - Trait that governs
BufReader’s behavior. - Writer
Policy - A trait which tells
BufWriterwhen to flush.