bytesbox 0.4.0

ByteBox is a high-performance hash map implementation optimized for byte slices. It efficiently maps keys and values of type Vec<u8>, providing full ownership of the data. ByteBox uses a custom hash function with linked-list-based collision handling, ensuring low memory overhead and optimal performance.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use ::bytesbox::ByteBox;

#[test]
fn remove() {
    let mut byte_box = ByteBox::new();

    let key = b"key";
    let val = b"value";

    byte_box.insert(key, val);
    assert_eq!(byte_box.get(key), Some(&val[..]));

    let removed = byte_box.remove(key);
    assert_eq!(removed, Some(val.to_vec()));
    assert_eq!(byte_box.get(key), None);
}