6 releases (3 major breaking)

3.0.0 Jul 28, 2022
2.0.0 Nov 27, 2021
1.0.0 Nov 27, 2021
0.3.0 Nov 21, 2021
0.1.0 Oct 4, 2019

#1911 in Rust patterns

Download history 7572/week @ 2024-08-24 7068/week @ 2024-08-31 6254/week @ 2024-09-07 5683/week @ 2024-09-14 6651/week @ 2024-09-21 5976/week @ 2024-09-28 7001/week @ 2024-10-05 7637/week @ 2024-10-12 7820/week @ 2024-10-19 8474/week @ 2024-10-26 7834/week @ 2024-11-02 8802/week @ 2024-11-09 7783/week @ 2024-11-16 6800/week @ 2024-11-23 8137/week @ 2024-11-30 6473/week @ 2024-12-07

30,893 downloads per month
Used in 17 crates (via pcap-file)

MIT license

19KB
476 lines

byteorder_slice

Provides convenience methods for reading numbers and slices from a slice

Usage

Use byteorder_slice = "1.0.0" if you want reads to return an Option.

Use byteorder_slice = "2.0.0" if you want reads to return a std::io::Result.

use byteorder_slice::{BigEndian, LittleEndian, ReadSlice}
let data = vec![0_u8; 100];
let src = &mut &data[..];

let a = src.read_u8().unwrap();
let b = src.read_u32::<BigEndian>().unwrap();
let c = src.read_uint::<LittleEndian>(3).unwrap();
let d = src.read_slice(10).unwrap();

Dependencies

~115KB