Trait winter_utils::ByteWriter
source · pub trait ByteWriter: Sized {
fn write_u8(&mut self, value: u8);
fn write_u8_slice(&mut self, values: &[u8]);
fn write_u16(&mut self, value: u16) { ... }
fn write_u32(&mut self, value: u32) { ... }
fn write_u64(&mut self, value: u64) { ... }
fn write<S: Serializable>(&mut self, value: S) { ... }
}
Expand description
Defines how primitive values are to be written into Self
.
Required Methods
sourcefn write_u8_slice(&mut self, values: &[u8])
fn write_u8_slice(&mut self, values: &[u8])
Writes a sequence of bytes into self
.
Panics
Panics if the sequence of bytes could not be written into self
.
Provided Methods
sourcefn write_u16(&mut self, value: u16)
fn write_u16(&mut self, value: u16)
Writes a u16 value in little-endian byte order into self
.
Panics
Panics if the value could not be written into self
.
sourcefn write_u32(&mut self, value: u32)
fn write_u32(&mut self, value: u32)
Writes a u32 value in little-endian byte order into self
.
Panics
Panics if the value could not be written into self
.
sourcefn write_u64(&mut self, value: u64)
fn write_u64(&mut self, value: u64)
Writes a u64 value in little-endian byte order into self
.
Panics
Panics if the value could not be written into self
.