compact-map 0.1.0

'Small map' optimization: store up to a small number of key-value pairs on the stack.
Documentation
  • Coverage
  • 100%
    53 out of 53 items documented39 out of 43 items with examples
  • Size
  • Source code size: 114.33 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 14.3 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • lightsing/compact-map
    4 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lightsing

compact-map

Crates.io Documentation Latest Docs MIT licensed

'Small map' optimization: store up to a small number of key-value pairs on the stack.

Provides '1:1' API compatibility with std::collections::HashMap.

Example

use compact_map::CompactMap;

fn main() {
    let mut map = CompactMap::default(); // default capacity is 16
    // or you can specify the capacity
    // let mut map: CompactMap<&str, i32, 32> = CompactMap::default();

    map.insert("a", 1);
    map.insert("b", 2);
}