#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

#11 in #deal

Download history 215/week @ 2024-04-08 8/week @ 2024-04-22 19/week @ 2024-04-29 9/week @ 2024-05-20 1/week @ 2024-06-03 8/week @ 2024-06-17 12/week @ 2024-06-24 139/week @ 2024-07-01 2/week @ 2024-07-08 62/week @ 2024-07-15 54/week @ 2024-07-22

258 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