3 unstable releases
0.2.1 | Jun 13, 2021 |
---|---|
0.2.0 | Oct 15, 2020 |
0.1.0 | Oct 14, 2020 |
#2203 in Rust patterns
24KB
449 lines
quartet
Nibble (nyble, nybble, half-byte, semi-octet, quadbit, quartet, hex digit, u4, nib) slices and references
use quartet::NibSlice;
let n = NibSlice::from_bytes_skip_last(&[0x12, 0x34]);
// 3 nibbles
assert_eq!(n.len(), 3);
// indexing uses the `index()` function (need to return structures)
let m = n.index(1..);
// 2 nibbles
assert_eq!(m.len(), 2);
// [2, 3]
assert_eq!(m, NibSlice::from_bytes(&[0x23]));
Comparison of avaliable nibble crates
License
This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
In addition to the permissions in the GNU General Public License, the authors give you unlimited permission to link the compiled version of this library into combinations with other programs, and to distribute those programs without any restriction coming from the use of this library. (The General Public License restrictions do apply in other respects; for example, they cover modification of the library, and distribution when not linked into another program.)
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.