Crates.io | io_ext |
lib.rs | io_ext |
version | 0.2.0 |
source | src |
created_at | 2021-11-05 20:44:01.966759 |
updated_at | 2021-11-13 10:14:38.079411 |
description | Read & Write extensions to deal with primitive types |
homepage | |
repository | https://github.com/sy1ntexx/io_ext |
max_upload_size | |
id | 477496 |
size | 9,146 |
Extensions for Read
& Write
traits from standard library to make work with primitive types easier.
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);
}