pub trait BufWriter {
    // Required method
    fn put_slice(&mut self, slice: &[u8]);

    // Provided methods
    fn put_u8(&mut self, val: u8) { ... }
    fn put_u16(&mut self, val: u16) { ... }
    fn put_u32(&mut self, val: u32) { ... }
    fn put_u64(&mut self, val: u64) { ... }
    fn put_u128(&mut self, val: u128) { ... }
    fn put_i8(&mut self, val: i8) { ... }
    fn put_i16(&mut self, val: i16) { ... }
    fn put_i32(&mut self, val: i32) { ... }
    fn put_i64(&mut self, val: i64) { ... }
    fn put_i128(&mut self, val: i128) { ... }
}
Expand description

A buffered writer of some kind.

Required Methods§

source

fn put_slice(&mut self, slice: &[u8])

Writes the slice to the buffer.

This is the only method implementations are required to define. All other methods are provided.

Provided Methods§

source

fn put_u8(&mut self, val: u8)

Writes a u8 to the buffer in little-endian (LE) encoding.

source

fn put_u16(&mut self, val: u16)

Writes a u16 to the buffer in little-endian (LE) encoding.

source

fn put_u32(&mut self, val: u32)

Writes a u32 to the buffer in little-endian (LE) encoding.

source

fn put_u64(&mut self, val: u64)

Writes a u64 to the buffer in little-endian (LE) encoding.

source

fn put_u128(&mut self, val: u128)

Writes a u128 to the buffer in little-endian (LE) encoding.

source

fn put_i8(&mut self, val: i8)

Writes an i8 to the buffer in little-endian (LE) encoding.

source

fn put_i16(&mut self, val: i16)

Writes an i16 to the buffer in little-endian (LE) encoding.

source

fn put_i32(&mut self, val: i32)

Writes an i32 to the buffer in little-endian (LE) encoding.

source

fn put_i64(&mut self, val: i64)

Writes an i64 to the buffer in little-endian (LE) encoding.

source

fn put_i128(&mut self, val: i128)

Writes an i128 to the buffer in little-endian (LE) encoding.

Implementations on Foreign Types§

source§

impl BufWriter for &mut [u8]

source§

fn put_slice(&mut self, slice: &[u8])

source§

impl BufWriter for Vec<u8>

source§

fn put_slice(&mut self, slice: &[u8])

Implementors§