pub trait KffWrite {
// Required method
fn write_bytes(&mut self, bytes: &[u8]) -> Result<()>;
// Provided methods
fn write_ascii(&mut self, ascii: &[u8]) -> Result<()> { ... }
fn write_bool(&mut self, value: &bool) -> Result<()> { ... }
fn write_u8(&mut self, value: &u8) -> Result<()> { ... }
fn write_u16(&mut self, value: &u16) -> Result<()> { ... }
fn write_u32(&mut self, value: &u32) -> Result<()> { ... }
fn write_u64(&mut self, value: &u64) -> Result<()> { ... }
fn write_i64(&mut self, value: &i64) -> Result<()> { ... }
}Expand description
Define trait containts utils function to write kff
Required Methods§
sourcefn write_bytes(&mut self, bytes: &[u8]) -> Result<()>
fn write_bytes(&mut self, bytes: &[u8]) -> Result<()>
Function that write all bytes
Provided Methods§
sourcefn write_ascii(&mut self, ascii: &[u8]) -> Result<()>
fn write_ascii(&mut self, ascii: &[u8]) -> Result<()>
Function that write bytes plus a ‘\0’ at end
sourcefn write_bool(&mut self, value: &bool) -> Result<()>
fn write_bool(&mut self, value: &bool) -> Result<()>
Function that write one bit and convert it as bool