Trait BinaryRead

Source
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§

Source

fn read_u8(&mut self) -> Result<u8>

Reads a u8 (1 byte(s)).

Source

fn read_u16(&mut self) -> Result<u16>

Reads a u16 (2 byte(s)).

Source

fn read_u32(&mut self) -> Result<u32>

Reads a u32 (4 byte(s)).

Source

fn read_u64(&mut self) -> Result<u64>

Reads a u64 (8 byte(s)).

Source

fn read_i8(&mut self) -> Result<i8>

Reads a i8 (1 byte(s)).

Source

fn read_i16(&mut self) -> Result<i16>

Reads a i16 (2 byte(s)).

Source

fn read_i32(&mut self) -> Result<i32>

Reads a i32 (4 byte(s)).

Source

fn read_i64(&mut self) -> Result<i64>

Reads a i64 (8 byte(s)).

Source

fn read_f32(&mut self) -> Result<f32>

Reads a f32 (4 byte(s)).

Source

fn read_f64(&mut self) -> Result<f64>

Reads a f64 (8 byte(s)).

Source

fn read_array_len(&mut self) -> Result<usize>

Reads the length for an array.

Provided Methods§

Source

fn read_bool(&mut self) -> Result<bool>

Reads a bool (1 byte).

Source

fn read_bool_array(&mut self, len: Option<usize>) -> Result<Vec<bool>>

Reads an array of bools (1 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_char(&mut self) -> Result<char>

Reads a char (1 byte).

Source

fn read_char_array(&mut self, len: Option<usize>) -> Result<Vec<char>>

Reads an array of chars (1 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_u8_array(&mut self, len: Option<usize>) -> Result<Vec<u8>>

Reads an array of u8s (1 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_u16_array(&mut self, len: Option<usize>) -> Result<Vec<u16>>

Reads an array of u16s (2 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_u32_array(&mut self, len: Option<usize>) -> Result<Vec<u32>>

Reads an array of u32s (4 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_u64_array(&mut self, len: Option<usize>) -> Result<Vec<u64>>

Reads an array of u64s (8 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_i8_array(&mut self, len: Option<usize>) -> Result<Vec<i8>>

Reads an array of i8s (1 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_i16_array(&mut self, len: Option<usize>) -> Result<Vec<i16>>

Reads an array of i16s (2 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_i32_array(&mut self, len: Option<usize>) -> Result<Vec<i32>>

Reads an array of i32s (4 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_i64_array(&mut self, len: Option<usize>) -> Result<Vec<i64>>

Reads an array of i64s (8 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_f16(&mut self) -> Result<f32>

Reads a [f16] (2 bytes).

Source

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.

Source

fn read_f32_array(&mut self, len: Option<usize>) -> Result<Vec<f32>>

Reads an array of f32s (4 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_f64_array(&mut self, len: Option<usize>) -> Result<Vec<f64>>

Reads an array of f64s (8 byte(s) each). If len is none the reader will determine the length by reading it.

Source

fn read_cstr(&mut self) -> Result<String>

Reads a c-string (null terminated string).

Source

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.

Source

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.

Source

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.

Source

fn read_str_array(&mut self, len: Option<usize>) -> Result<Vec<String>>

Reads an array of strings. If len is none the reader will determine the length by reading it.

Source

fn read_bytes_array(&mut self, len: Option<usize>) -> Result<Vec<Vec<u8>>>

Reads an array of bytes. If len is none the reader will determine the length by reading it.

Implementors§