Trait simple_bytes::BytesWrite[][src]

pub trait BytesWrite {
Show methods fn as_mut(&mut self) -> &mut [u8];
fn as_bytes(&self) -> Bytes<'_>;
fn remaining_mut(&mut self) -> &mut [u8];
fn write(&mut self, slice: &[u8]); fn write_u8(&mut self, num: u8) { ... }
fn write_u16(&mut self, num: u16) { ... }
fn write_u32(&mut self, num: u32) { ... }
fn write_u64(&mut self, num: u64) { ... }
fn write_u128(&mut self, num: u128) { ... }
fn write_i8(&mut self, num: i8) { ... }
fn write_i16(&mut self, num: i16) { ... }
fn write_i32(&mut self, num: i32) { ... }
fn write_i64(&mut self, num: i64) { ... }
fn write_i128(&mut self, num: i128) { ... }
fn write_f32(&mut self, num: f32) { ... }
fn write_f64(&mut self, num: f64) { ... }
}
Expand description

Write bytes or numbers.

Required methods

Returns the entire slice mutably.

Returns the entire slice as a bytes struct setting the position of the new Bytes to 0.

Returns the remaining bytes mutably.

Writes a slice.

Panics

If there aren’t enough remaining bytes left.

Provided methods

Writes an u8.

Panics

If there aren’t enough remaining bytes left.

Writes an u16.

Panics

If there aren’t enough remaining bytes left.

Writes an u32.

Panics

If there aren’t enough remaining bytes left.

Writes an u64.

Panics

If there aren’t enough remaining bytes left.

Writes an u128.

Panics

If there aren’t enough remaining bytes left.

Writes an i8.

Panics

If there aren’t enough remaining bytes left.

Writes an i16.

Panics

If there aren’t enough remaining bytes left.

Writes an i32.

Panics

If there aren’t enough remaining bytes left.

Writes an i64.

Panics

If there aren’t enough remaining bytes left.

Writes an i128.

Panics

If there aren’t enough remaining bytes left.

Writes an f32.

Panics

If there aren’t enough remaining bytes left.

Writes an f64.

Panics

If there aren’t enough remaining bytes left.

Implementors

Returns the remaining mutable slice.

If an empty slice is returned, this does not mean you can’t write anymore.

Writes a slice. Allocates more space if the slice is bigger than the Vec.

Returns the remaining mutable slice.

If an empty slice is returned, this does not mean you can’t write anymore.

Write a slice. Allocates more space if the slice is bigger than the Vec.

Returns the remaining mutable slice.

If an empty slice is returned, this does not mean you can’t write anymore.

Write a slice. Allocates more space if the slice is bigger than the Vec.