pub trait BinaryWrite {
Show 32 methods
// Required methods
fn write_bool(&mut self, value: bool) -> Result<()>;
fn write_char(&mut self, value: char) -> Result<()>;
fn write_u8(&mut self, value: u8) -> Result<()>;
fn write_u16(&mut self, value: u16) -> Result<()>;
fn write_u32(&mut self, value: u32) -> Result<()>;
fn write_u64(&mut self, value: u64) -> Result<()>;
fn write_i8(&mut self, value: i8) -> Result<()>;
fn write_i16(&mut self, value: i16) -> Result<()>;
fn write_i32(&mut self, value: i32) -> Result<()>;
fn write_i64(&mut self, value: i64) -> Result<()>;
fn write_f16(&mut self, value: f32) -> Result<()>;
fn write_f32(&mut self, value: f32) -> Result<()>;
fn write_f64(&mut self, value: f64) -> Result<()>;
fn write_cstr(&mut self, value: &str) -> Result<()>;
fn write_str(&mut self, value: &str, write_len: Option<bool>) -> Result<()>;
fn write_bytes(
&mut self,
value: &[u8],
write_len: Option<bool>,
) -> Result<()>;
fn write_bool_array(
&mut self,
value: Vec<bool>,
write_len: Option<bool>,
) -> Result<()>;
fn write_char_array(
&mut self,
value: Vec<char>,
write_len: Option<bool>,
) -> Result<()>;
fn write_u8_array(
&mut self,
value: Vec<u8>,
write_len: Option<bool>,
) -> Result<()>;
fn write_u16_array(
&mut self,
value: Vec<u16>,
write_len: Option<bool>,
) -> Result<()>;
fn write_u32_array(
&mut self,
value: Vec<u32>,
write_len: Option<bool>,
) -> Result<()>;
fn write_u64_array(
&mut self,
value: Vec<u64>,
write_len: Option<bool>,
) -> Result<()>;
fn write_i8_array(
&mut self,
value: Vec<i8>,
write_len: Option<bool>,
) -> Result<()>;
fn write_i16_array(
&mut self,
value: Vec<i16>,
write_len: Option<bool>,
) -> Result<()>;
fn write_i32_array(
&mut self,
value: Vec<i32>,
write_len: Option<bool>,
) -> Result<()>;
fn write_i64_array(
&mut self,
value: Vec<i64>,
write_len: Option<bool>,
) -> Result<()>;
fn write_f16_array(
&mut self,
value: Vec<f32>,
write_len: Option<bool>,
) -> Result<()>;
fn write_f32_array(
&mut self,
value: Vec<f32>,
write_len: Option<bool>,
) -> Result<()>;
fn write_f64_array(
&mut self,
value: Vec<f64>,
write_len: Option<bool>,
) -> Result<()>;
fn write_cstr_array(
&mut self,
value: Vec<&str>,
write_len: Option<bool>,
) -> Result<()>;
fn write_str_array(
&mut self,
value: Vec<&str>,
write_len: Option<bool>,
) -> Result<()>;
fn write_bytes_array(
&mut self,
value: Vec<&[u8]>,
write_len: Option<bool>,
) -> Result<()>;
}Required Methods§
Sourcefn write_bool(&mut self, value: bool) -> Result<()>
fn write_bool(&mut self, value: bool) -> Result<()>
Writes a bool to the internal stream.
Sourcefn write_char(&mut self, value: char) -> Result<()>
fn write_char(&mut self, value: char) -> Result<()>
Writes a char to the internal stream.
Sourcefn write_cstr(&mut self, value: &str) -> Result<()>
fn write_cstr(&mut self, value: &str) -> Result<()>
Writes a str as c-string (null-terminated) to the internal stream.
Sourcefn write_str(&mut self, value: &str, write_len: Option<bool>) -> Result<()>
fn write_str(&mut self, value: &str, write_len: Option<bool>) -> Result<()>
Writes a str to the internal stream. If write_len is Some(true), the length of the string will be written before the string itself.
Sourcefn write_bytes(&mut self, value: &[u8], write_len: Option<bool>) -> Result<()>
fn write_bytes(&mut self, value: &[u8], write_len: Option<bool>) -> Result<()>
Writes a byte slice to the internal stream. If write_len is Some(true), the length of the byte slice will be written before the byte slice itself.
Sourcefn write_bool_array(
&mut self,
value: Vec<bool>,
write_len: Option<bool>,
) -> Result<()>
fn write_bool_array( &mut self, value: Vec<bool>, write_len: Option<bool>, ) -> Result<()>
Writes a bool array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_char_array(
&mut self,
value: Vec<char>,
write_len: Option<bool>,
) -> Result<()>
fn write_char_array( &mut self, value: Vec<char>, write_len: Option<bool>, ) -> Result<()>
Writes a char array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_u8_array(
&mut self,
value: Vec<u8>,
write_len: Option<bool>,
) -> Result<()>
fn write_u8_array( &mut self, value: Vec<u8>, write_len: Option<bool>, ) -> Result<()>
Writes a u8 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_u16_array(
&mut self,
value: Vec<u16>,
write_len: Option<bool>,
) -> Result<()>
fn write_u16_array( &mut self, value: Vec<u16>, write_len: Option<bool>, ) -> Result<()>
Writes a u16 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_u32_array(
&mut self,
value: Vec<u32>,
write_len: Option<bool>,
) -> Result<()>
fn write_u32_array( &mut self, value: Vec<u32>, write_len: Option<bool>, ) -> Result<()>
Writes a u32 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_u64_array(
&mut self,
value: Vec<u64>,
write_len: Option<bool>,
) -> Result<()>
fn write_u64_array( &mut self, value: Vec<u64>, write_len: Option<bool>, ) -> Result<()>
Writes a u64 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_i8_array(
&mut self,
value: Vec<i8>,
write_len: Option<bool>,
) -> Result<()>
fn write_i8_array( &mut self, value: Vec<i8>, write_len: Option<bool>, ) -> Result<()>
Writes a i8 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_i16_array(
&mut self,
value: Vec<i16>,
write_len: Option<bool>,
) -> Result<()>
fn write_i16_array( &mut self, value: Vec<i16>, write_len: Option<bool>, ) -> Result<()>
Writes a i16 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_i32_array(
&mut self,
value: Vec<i32>,
write_len: Option<bool>,
) -> Result<()>
fn write_i32_array( &mut self, value: Vec<i32>, write_len: Option<bool>, ) -> Result<()>
Writes a i32 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_i64_array(
&mut self,
value: Vec<i64>,
write_len: Option<bool>,
) -> Result<()>
fn write_i64_array( &mut self, value: Vec<i64>, write_len: Option<bool>, ) -> Result<()>
Writes a i64 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_f16_array(
&mut self,
value: Vec<f32>,
write_len: Option<bool>,
) -> Result<()>
fn write_f16_array( &mut self, value: Vec<f32>, write_len: Option<bool>, ) -> Result<()>
Writes a f16 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_f32_array(
&mut self,
value: Vec<f32>,
write_len: Option<bool>,
) -> Result<()>
fn write_f32_array( &mut self, value: Vec<f32>, write_len: Option<bool>, ) -> Result<()>
Writes a f32 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_f64_array(
&mut self,
value: Vec<f64>,
write_len: Option<bool>,
) -> Result<()>
fn write_f64_array( &mut self, value: Vec<f64>, write_len: Option<bool>, ) -> Result<()>
Writes a f64 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Sourcefn write_cstr_array(
&mut self,
value: Vec<&str>,
write_len: Option<bool>,
) -> Result<()>
fn write_cstr_array( &mut self, value: Vec<&str>, write_len: Option<bool>, ) -> Result<()>
Writes a str array as c-strings (null-terminated) to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".