compact-map

Crates.iocompact-map
lib.rscompact-map
version0.1.0
sourcesrc
created_at2024-04-18 11:08:19.320481
updated_at2024-04-18 11:08:19.320481
description'Small map' optimization: store up to a small number of key-value pairs on the stack.
homepage
repositoryhttps://github.com/lightsing/compact-map.git
max_upload_size
id1212413
size113,809
Akase Haruka (lightsing)

documentation

https://docs.rs/compact-map

README

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);
}
Commit count: 5

cargo fmt