pub trait BinaryRead {
Show 33 methods
// Required methods
fn read_u8(&mut self) -> Result<u8>;
fn read_u16(&mut self) -> Result<u16>;
fn read_u32(&mut self) -> Result<u32>;
fn read_u64(&mut self) -> Result<u64>;
fn read_i8(&mut self) -> Result<i8>;
fn read_i16(&mut self) -> Result<i16>;
fn read_i32(&mut self) -> Result<i32>;
fn read_i64(&mut self) -> Result<i64>;
fn read_f32(&mut self) -> Result<f32>;
fn read_f64(&mut self) -> Result<f64>;
fn read_array_len(&mut self) -> Result<usize>;
// Provided methods
fn read_bool(&mut self) -> Result<bool> { ... }
fn read_bool_array(&mut self, len: Option<usize>) -> Result<Vec<bool>> { ... }
fn read_char(&mut self) -> Result<char> { ... }
fn read_char_array(&mut self, len: Option<usize>) -> Result<Vec<char>> { ... }
fn read_u8_array(&mut self, len: Option<usize>) -> Result<Vec<u8>> { ... }
fn read_u16_array(&mut self, len: Option<usize>) -> Result<Vec<u16>> { ... }
fn read_u32_array(&mut self, len: Option<usize>) -> Result<Vec<u32>> { ... }
fn read_u64_array(&mut self, len: Option<usize>) -> Result<Vec<u64>> { ... }
fn read_i8_array(&mut self, len: Option<usize>) -> Result<Vec<i8>> { ... }
fn read_i16_array(&mut self, len: Option<usize>) -> Result<Vec<i16>> { ... }
fn read_i32_array(&mut self, len: Option<usize>) -> Result<Vec<i32>> { ... }
fn read_i64_array(&mut self, len: Option<usize>) -> Result<Vec<i64>> { ... }
fn read_f16(&mut self) -> Result<f32> { ... }
fn read_f16_array(&mut self, len: Option<usize>) -> Result<Vec<f32>> { ... }
fn read_f32_array(&mut self, len: Option<usize>) -> Result<Vec<f32>> { ... }
fn read_f64_array(&mut self, len: Option<usize>) -> Result<Vec<f64>> { ... }
fn read_cstr(&mut self) -> Result<String> { ... }
fn read_str(&mut self, len: Option<usize>) -> Result<String> { ... }
fn read_bytes(&mut self, len: Option<usize>) -> Result<Vec<u8>> { ... }
fn read_cstr_array(&mut self, len: Option<usize>) -> Result<Vec<String>> { ... }
fn read_str_array(&mut self, len: Option<usize>) -> Result<Vec<String>> { ... }
fn read_bytes_array(&mut self, len: Option<usize>) -> Result<Vec<Vec<u8>>> { ... }
}
Required Methods§
Sourcefn read_array_len(&mut self) -> Result<usize>
fn read_array_len(&mut self) -> Result<usize>
Reads the length for an array.
Provided Methods§
Sourcefn read_bool_array(&mut self, len: Option<usize>) -> Result<Vec<bool>>
fn read_bool_array(&mut self, len: Option<usize>) -> Result<Vec<bool>>
Reads an array of bool
s (1 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_char_array(&mut self, len: Option<usize>) -> Result<Vec<char>>
fn read_char_array(&mut self, len: Option<usize>) -> Result<Vec<char>>
Reads an array of char
s (1 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_u8_array(&mut self, len: Option<usize>) -> Result<Vec<u8>>
fn read_u8_array(&mut self, len: Option<usize>) -> Result<Vec<u8>>
Reads an array of u8
s (1 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_u16_array(&mut self, len: Option<usize>) -> Result<Vec<u16>>
fn read_u16_array(&mut self, len: Option<usize>) -> Result<Vec<u16>>
Reads an array of u16
s (2 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_u32_array(&mut self, len: Option<usize>) -> Result<Vec<u32>>
fn read_u32_array(&mut self, len: Option<usize>) -> Result<Vec<u32>>
Reads an array of u32
s (4 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_u64_array(&mut self, len: Option<usize>) -> Result<Vec<u64>>
fn read_u64_array(&mut self, len: Option<usize>) -> Result<Vec<u64>>
Reads an array of u64
s (8 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_i8_array(&mut self, len: Option<usize>) -> Result<Vec<i8>>
fn read_i8_array(&mut self, len: Option<usize>) -> Result<Vec<i8>>
Reads an array of i8
s (1 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_i16_array(&mut self, len: Option<usize>) -> Result<Vec<i16>>
fn read_i16_array(&mut self, len: Option<usize>) -> Result<Vec<i16>>
Reads an array of i16
s (2 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_i32_array(&mut self, len: Option<usize>) -> Result<Vec<i32>>
fn read_i32_array(&mut self, len: Option<usize>) -> Result<Vec<i32>>
Reads an array of i32
s (4 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_i64_array(&mut self, len: Option<usize>) -> Result<Vec<i64>>
fn read_i64_array(&mut self, len: Option<usize>) -> Result<Vec<i64>>
Reads an array of i64
s (8 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_f16_array(&mut self, len: Option<usize>) -> Result<Vec<f32>>
fn read_f16_array(&mut self, len: Option<usize>) -> Result<Vec<f32>>
Reads an array of [f16
]s (2 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_f32_array(&mut self, len: Option<usize>) -> Result<Vec<f32>>
fn read_f32_array(&mut self, len: Option<usize>) -> Result<Vec<f32>>
Reads an array of f32
s (4 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_f64_array(&mut self, len: Option<usize>) -> Result<Vec<f64>>
fn read_f64_array(&mut self, len: Option<usize>) -> Result<Vec<f64>>
Reads an array of f64
s (8 byte(s) each). If len is none the reader will determine the length by reading it.
Sourcefn read_str(&mut self, len: Option<usize>) -> Result<String>
fn read_str(&mut self, len: Option<usize>) -> Result<String>
Reads a string. If len is none the reader will determine the length by reading it.
Sourcefn read_bytes(&mut self, len: Option<usize>) -> Result<Vec<u8>>
fn read_bytes(&mut self, len: Option<usize>) -> Result<Vec<u8>>
Reads bytes as Vec<u8>
. If len is none the reader will determine the length by reading it.
Sourcefn read_cstr_array(&mut self, len: Option<usize>) -> Result<Vec<String>>
fn read_cstr_array(&mut self, len: Option<usize>) -> Result<Vec<String>>
Reads an array of c-strings. If len is none the reader will determine the length by reading it.