Skip to main content

WriteBytesExt

Trait WriteBytesExt 

Source
pub trait WriteBytesExt: Write {
    // Provided methods
    fn write_u16<T: ByteOrder>(&mut self, n: u16) -> Result<()> { ... }
    fn write_u32<T: ByteOrder>(&mut self, n: u32) -> Result<()> { ... }
    fn write_u64<T: ByteOrder>(&mut self, n: u64) -> Result<()> { ... }
    fn write_i16<T: ByteOrder>(&mut self, n: i16) -> Result<()> { ... }
    fn write_i32<T: ByteOrder>(&mut self, n: i32) -> Result<()> { ... }
    fn write_i64<T: ByteOrder>(&mut self, n: i64) -> Result<()> { ... }
    fn write_f32<T: ByteOrder>(&mut self, n: f32) -> Result<()> { ... }
    fn write_f64<T: ByteOrder>(&mut self, n: f64) -> Result<()> { ... }
    fn write_u8(&mut self, n: u8) -> Result<()> { ... }
    fn write_i8(&mut self, n: i8) -> Result<()> { ... }
}
Expand description

Extension trait for writing binary data.

Provided Methods§

Source

fn write_u16<T: ByteOrder>(&mut self, n: u16) -> Result<()>

Write a u16 value.

Source

fn write_u32<T: ByteOrder>(&mut self, n: u32) -> Result<()>

Write a u32 value.

Source

fn write_u64<T: ByteOrder>(&mut self, n: u64) -> Result<()>

Write a u64 value.

Source

fn write_i16<T: ByteOrder>(&mut self, n: i16) -> Result<()>

Write an i16 value.

Source

fn write_i32<T: ByteOrder>(&mut self, n: i32) -> Result<()>

Write an i32 value.

Source

fn write_i64<T: ByteOrder>(&mut self, n: i64) -> Result<()>

Write an i64 value.

Source

fn write_f32<T: ByteOrder>(&mut self, n: f32) -> Result<()>

Write an f32 value.

Source

fn write_f64<T: ByteOrder>(&mut self, n: f64) -> Result<()>

Write an f64 value.

Source

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

Write a u8 value.

Source

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

Write an i8 value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§