Expand description
read-primitives provides traits to read primitive types from any type that implements std::io::Read
§Examples
use read_primitives::ReadF64;
let bytes: [u8; 8] = [24, 45, 68, 84, 251, 33, 9, 64];
let float = bytes.as_slice().read_le_f64().unwrap();
assert_eq!(std::f64::consts::PI, float)
Traits§
- Read
Bool - Trait to read bool
- Read
Char - Trait to read char
- ReadF32
- Trait to read f32.
- ReadF64
- Trait to read f64.
- ReadI16
- Trait to read i16.
- ReadI32
- Trait to read i32.
- ReadI64
- Trait to read i64.
- Read
I128 - Trait to read i128.
- Read
Isize - Trait to read isize.
- ReadU8
- Trait to read u8
- ReadU16
- Trait to read u16.
- ReadU32
- Trait to read u32.
- ReadU64
- Trait to read u64.
- Read
U128 - Trait to read u128.
- Read
Usize - Trait to read usize.