Skip to content
/ handlebox Public

A map-like collection that reuses unused keys

License

Notifications You must be signed in to change notification settings

pcsm/handlebox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Handlebox Docs Crates.io

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);

About

A map-like collection that reuses unused keys

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages