Trait genio::bufio::BufWrite [] [src]

pub trait BufWrite: Write {
    fn request_buffer(&mut self, min: usize, max: Option<usize>) -> &mut [u8];
    fn submit_buffer(&mut self, size: usize);
}

When writing, it might be better to serialize directly into a buffer. This trait allows such situation.

Required Methods

Requests buffer for writing. min hints that at least min bytes will be written. Some(max) hints that at most max bytes will be written. However, consumer can't rely on buffer returning any amount and must check it by calling len() on returned buffer.

Tells the buf writer that size bytes were written into buffer.

Implementors