#read-write #extension #primitive #ext #deal #type #io-write

io_ext

Read & Write extensions to deal with primitive types

2 unstable releases

0.2.0 Nov 13, 2021
0.1.0 Nov 5, 2021

#12 in #deal

Download history 46/week @ 2024-11-13 54/week @ 2024-11-20 138/week @ 2024-11-27 55/week @ 2024-12-04 53/week @ 2024-12-11 43/week @ 2024-12-18 3/week @ 2024-12-25 10/week @ 2025-01-01 14/week @ 2025-01-08 66/week @ 2025-01-15 18/week @ 2025-01-29 25/week @ 2025-02-05 41/week @ 2025-02-12 29/week @ 2025-02-19 10/week @ 2025-02-26

106 downloads per month

MIT license

9KB
117 lines

io_ext

Extensions for Read & Write traits from standard library to make work with primitive types easier.

Usage

fn main() {
    use io_ext::ReadExt;

    let data = b"\x00\x02\x03\x00";
    let mut slice = &data[..];
    assert_eq!(slice.read_u16_be(), 2);
    assert_eq!(slice.read_u16_le(), 3);
}

lib.rs:

io_ext Provies methods to deal with primitive types from std::io::Read & std::io::Write

Dependencies

~4KB