pub trait WriteBytesExt: Write {
// Provided methods
fn write_u8(&mut self, n: u8) -> Result<()> { ... }
fn write_u32<T>(&mut self, n: u32) -> Result<()>
where T: ByteOrder { ... }
fn write_i32<T>(&mut self, n: i32) -> Result<()>
where T: ByteOrder { ... }
fn write_u64<T>(&mut self, n: u64) -> Result<()>
where T: ByteOrder { ... }
fn write_i64<T>(&mut self, n: i64) -> Result<()>
where T: ByteOrder { ... }
fn write_f32<T>(&mut self, n: f32) -> Result<()>
where T: ByteOrder { ... }
fn write_f64<T>(&mut self, n: f64) -> Result<()>
where T: ByteOrder { ... }
}Expand description
Extends io::Write with methods for writing numbers.
Each method writes the whole value with io::Write::write_all, and returns its error if it fails.
Provided Methods§
Sourcefn write_u32<T>(&mut self, n: u32) -> Result<()>where
T: ByteOrder,
fn write_u32<T>(&mut self, n: u32) -> Result<()>where
T: ByteOrder,
Writes an unsigned 32-bit integer in the byte order T.
Sourcefn write_i32<T>(&mut self, n: i32) -> Result<()>where
T: ByteOrder,
fn write_i32<T>(&mut self, n: i32) -> Result<()>where
T: ByteOrder,
Writes a signed 32-bit integer in the byte order T.
Sourcefn write_u64<T>(&mut self, n: u64) -> Result<()>where
T: ByteOrder,
fn write_u64<T>(&mut self, n: u64) -> Result<()>where
T: ByteOrder,
Writes an unsigned 64-bit integer in the byte order T.
Sourcefn write_i64<T>(&mut self, n: i64) -> Result<()>where
T: ByteOrder,
fn write_i64<T>(&mut self, n: i64) -> Result<()>where
T: ByteOrder,
Writes a signed 64-bit integer in the byte order T.
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§
impl<W> WriteBytesExt for W
Available on crate feature
std only.