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§
- Flag for
ReaderPolicy
methods to signal whether or notBufReader
should read into the buffer. - Flag for
WriterPolicy
methods to tellBufWriter
how many bytes to flush to the underlying reader. - Flush the buffer if it contains at least the given number of bytes.
- Only ever flush exactly the given number of bytes, until the writer is empty.
- Flush the buffer if it contains the given byte.
- Flush the buffer if it contains a newline (
\n
). - A policy for
BufReader
which ensures there is at least the given number of bytes in the buffer, failing this only if the reader is at EOF. - Default policy for both
BufReader
andBufWriter
that reproduces the behaviors of theirstd::io
counterparts:
Traits§
- Trait that governs
BufReader
’s behavior. - A trait which tells
BufWriter
when to flush.