Crate read_primitives

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

ReadBool
Trait to read bool
ReadChar
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.
ReadI128
Trait to read i128.
ReadIsize
Trait to read isize.
ReadU8
Trait to read u8
ReadU16
Trait to read u16.
ReadU32
Trait to read u32.
ReadU64
Trait to read u64.
ReadU128
Trait to read u128.
ReadUsize
Trait to read usize.