zvariant

Trait WriteBytes

Source
pub trait WriteBytes {
    // Required methods
    fn write_u8(&mut self, endian: Endian, n: u8) -> Result<(), Error>;
    fn write_u16(&mut self, endian: Endian, n: u16) -> Result<(), Error>;
    fn write_u32(&mut self, endian: Endian, n: u32) -> Result<(), Error>;
    fn write_u64(&mut self, endian: Endian, n: u64) -> Result<(), Error>;
    fn write_u128(&mut self, endian: Endian, n: u128) -> Result<(), Error>;
    fn write_i8(&mut self, endian: Endian, n: i8) -> Result<(), Error>;
    fn write_i16(&mut self, endian: Endian, n: i16) -> Result<(), Error>;
    fn write_i32(&mut self, endian: Endian, n: i32) -> Result<(), Error>;
    fn write_i64(&mut self, endian: Endian, n: i64) -> Result<(), Error>;
    fn write_i128(&mut self, endian: Endian, n: i128) -> Result<(), Error>;
    fn write_f32(&mut self, endian: Endian, n: f32) -> Result<(), Error>;
    fn write_f64(&mut self, endian: Endian, n: f64) -> Result<(), Error>;
}
Expand description

A trait for writing bytes.

This is implemented for all types that implement Write.

Required Methods§

Source

fn write_u8(&mut self, endian: Endian, n: u8) -> Result<(), Error>

Write a u8.

Source

fn write_u16(&mut self, endian: Endian, n: u16) -> Result<(), Error>

Write a u16.

Source

fn write_u32(&mut self, endian: Endian, n: u32) -> Result<(), Error>

Write a u32.

Source

fn write_u64(&mut self, endian: Endian, n: u64) -> Result<(), Error>

Write a u64.

Source

fn write_u128(&mut self, endian: Endian, n: u128) -> Result<(), Error>

Write a u128.

Source

fn write_i8(&mut self, endian: Endian, n: i8) -> Result<(), Error>

Write a i8.

Source

fn write_i16(&mut self, endian: Endian, n: i16) -> Result<(), Error>

Write a i16.

Source

fn write_i32(&mut self, endian: Endian, n: i32) -> Result<(), Error>

Write a i32.

Source

fn write_i64(&mut self, endian: Endian, n: i64) -> Result<(), Error>

Write a i64.

Source

fn write_i128(&mut self, endian: Endian, n: i128) -> Result<(), Error>

Write a i128.

Source

fn write_f32(&mut self, endian: Endian, n: f32) -> Result<(), Error>

Write a f32.

Source

fn write_f64(&mut self, endian: Endian, n: f64) -> Result<(), Error>

Write a f64.

Implementors§

Source§

impl<W> WriteBytes for W
where W: Write,