Trait zvariant::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,