[][src]Struct buf_redux::policy::FlushExact

pub struct FlushExact(pub usize);

Only ever flush exactly the given number of bytes, until the writer is empty.

Trait Implementations

impl WriterPolicy for FlushExact[src]

fn before_write(&mut self, buf: &mut Buffer, incoming: usize) -> FlushAmt[src]

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()

fn after_write(&mut self, _buf: &Buffer) -> FlushAmt[src]

Flushes the given amount if possible, nothing otherwise.

impl Default for FlushExact[src]

impl Debug for FlushExact[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]