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

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

#14 in #deal

Download history 11/week @ 2024-08-30 29/week @ 2024-09-06 17/week @ 2024-09-13 44/week @ 2024-09-20 115/week @ 2024-09-27 30/week @ 2024-10-04 46/week @ 2024-10-11 44/week @ 2024-10-18 24/week @ 2024-10-25 24/week @ 2024-11-01 78/week @ 2024-11-08 53/week @ 2024-11-15 77/week @ 2024-11-22 107/week @ 2024-11-29 71/week @ 2024-12-06 54/week @ 2024-12-13

311 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