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

Trait to read bool
Trait to read char
Trait to read f32.
Trait to read f64.
Trait to read i16.
Trait to read i32.
Trait to read i64.
Trait to read i128.
Trait to read isize.
Trait to read u8
Trait to read u16.
Trait to read u32.
Trait to read u64.
Trait to read u128.
Trait to read usize.