Struct buffer_redux::policy::FlushExact
source · pub struct FlushExact(pub usize);
Expand description
Only ever flush exactly the given number of bytes, until the writer is empty.
Tuple Fields§
§0: usize
Trait Implementations§
source§impl Debug for FlushExact
impl Debug for FlushExact
source§impl Default for FlushExact
impl Default for FlushExact
source§fn default() -> FlushExact
fn default() -> FlushExact
Returns the “default value” for a type. Read more
source§impl WriterPolicy for FlushExact
impl WriterPolicy for FlushExact
source§fn before_write(&mut self, buf: &mut Buffer, incoming: usize) -> FlushAmt
fn before_write(&mut self, buf: &mut Buffer, incoming: usize) -> FlushAmt
Flushes the buffer if there is not enough room to fit incoming
bytes,
but only when the buffer contains at least self.0
bytes.
Otherwise, calls Buffer::make_room()
source§fn after_write(&mut self, _buf: &Buffer) -> FlushAmt
fn after_write(&mut self, _buf: &Buffer) -> FlushAmt
Flushes the given amount if possible, nothing otherwise.