Struct buf_redux::policy::StdPolicy[][src]

pub struct StdPolicy;

Default policy for both BufReader and BufWriter that reproduces the behaviors of their std::io counterparts:

  • BufReader: only reads when the buffer is empty, does not resize or move data.
  • BufWriter: only flushes the buffer when there is not enough room for an incoming write.

Trait Implementations

impl Debug for StdPolicy
[src]

Formats the value using the given formatter. Read more

impl Default for StdPolicy
[src]

Returns the "default value" for a type. Read more

impl ReaderPolicy for StdPolicy
[src]

Behavior of std::io::BufReader: the buffer will only be read into if it is empty.

Consulted before attempting to read into the buffer. Read more

Called after bytes are consumed from the buffer. Read more

impl WriterPolicy for StdPolicy
[src]

Default behavior of std::io::BufWriter: flush before a read into the buffer only if the incoming data is larger than the buffer's writable space.

Return FlushAmt(n > 0) if the buffer should be flushed before reading into it. If the returned amount is 0 or greater than the amount of buffered data, no flush is performed. Read more

Return true if the buffer should be flushed after reading into it. Read more

Auto Trait Implementations

impl Send for StdPolicy

impl Sync for StdPolicy