Skip to main content

WriteBytesExt

Trait WriteBytesExt 

Source
pub trait WriteBytesExt {
Show 14 methods // Required method fn write_bytes(&mut self, buf: &[u8]) -> Result<(), Error>; // Provided methods fn write_u8(&mut self, val: u8) -> Result<(), Error> { ... } fn write_i8(&mut self, val: i8) -> Result<(), Error> { ... } fn write_u16_be(&mut self, val: u16) -> Result<(), Error> { ... } fn write_i16_be(&mut self, val: i16) -> Result<(), Error> { ... } fn write_u24_be(&mut self, val: u32) -> Result<(), Error> { ... } fn write_u32_be(&mut self, val: u32) -> Result<(), Error> { ... } fn write_i32_be(&mut self, val: i32) -> Result<(), Error> { ... } fn write_u64_be(&mut self, val: u64) -> Result<(), Error> { ... } fn write_i64_be(&mut self, val: i64) -> Result<(), Error> { ... } fn write_u128_be(&mut self, val: u128) -> Result<(), Error> { ... } fn write_i128_be(&mut self, val: i128) -> Result<(), Error> { ... } fn write_f32_be(&mut self, val: f32) -> Result<(), Error> { ... } fn write_f64_be(&mut self, val: f64) -> Result<(), Error> { ... }
}
Expand description

Extension trait for writing big-endian values to a byte stream.

The only required method is write_bytes. Backed by embedded_io::Write via a blanket impl.

Required Methods§

Source

fn write_bytes(&mut self, buf: &[u8]) -> Result<(), Error>

Write all bytes from buf to the stream.

§Errors

Returns Error::Io if the underlying writer fails.

Provided Methods§

Source

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

Write a single u8.

§Errors

Returns Error::Io if the underlying writer fails.

Source

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

Write an i8.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_u16_be(&mut self, val: u16) -> Result<(), Error>

Write a u16 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_i16_be(&mut self, val: i16) -> Result<(), Error>

Write an i16 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_u24_be(&mut self, val: u32) -> Result<(), Error>

Write the lower 3 bytes of a u32 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_u32_be(&mut self, val: u32) -> Result<(), Error>

Write a u32 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_i32_be(&mut self, val: i32) -> Result<(), Error>

Write an i32 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_u64_be(&mut self, val: u64) -> Result<(), Error>

Write a u64 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_i64_be(&mut self, val: i64) -> Result<(), Error>

Write an i64 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_u128_be(&mut self, val: u128) -> Result<(), Error>

Write a u128 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_i128_be(&mut self, val: i128) -> Result<(), Error>

Write an i128 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_f32_be(&mut self, val: f32) -> Result<(), Error>

Write an f32 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Source

fn write_f64_be(&mut self, val: f64) -> Result<(), Error>

Write an f64 in big-endian byte order.

§Errors

Returns Error::Io if the underlying writer fails.

Implementors§