handlebox 0.3.0

A map-like collection that reuses unused keys
Documentation
  • Coverage
  • 22.22%
    2 out of 9 items documented0 out of 6 items with examples
  • Size
  • Source code size: 5.08 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.36 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • pcsm/handlebox
    0 1 5
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jasongrlicky

Handlebox

Handlebox is a simple map-like collection that reuses unused keys. Right now it's hard-coded to use u32 keys.

To install, add this line to your Cargo.toml:

[dependencies]
handlebox = "0.3.0"

Note that Handlebox has not yet reached version 1.0, so the API may change drastically between releases.

Example

use handlebox::*;

// Creating
let mut c = HandleBox::new();

// Adding values
let h1 = c.add(888);

// Accessing values
assert_eq!(c.get(&h1).unwrap(), &888);

// Removing values
c.remove(&h1);

// You can access the internal BTreeMap<u32, V> with the .map field
assert_eq!(c.map.values().len(), 0);