10 unstable releases (4 breaking)
0.5.2 | May 11, 2022 |
---|---|
0.5.1 | May 8, 2022 |
0.4.1 | Feb 6, 2022 |
0.4.0 | Jan 14, 2022 |
0.1.1 | Jun 25, 2020 |
#6 in #anymap
52 downloads per month
15KB
124 lines
🦀 StaticTypeMap
A map where the key is the type of the value.
⚠️ This crate has been renamed to erased_set
.
License
Licensed under MIT license.
lib.rs
:
🦀 StaticTypeMap
A map where the key is the type of the value.
You may be looking for:
Example
use static_type_map::TypeMap;
let mut type_map = TypeMap::new();
type_map.insert(10u8);
type_map.insert(20u16);
type_map.insert(true);
type_map.insert("a");
assert!(type_map.contains::<bool>());
assert_eq!(type_map.get::<&str>(), Some(&"a"));
if let Some(previous_value) = type_map.insert(50u8) {
assert_eq!(previous_value, 10u8);
}
type_map.remove::<u16>();
assert_eq!(type_map.len(), 3);
Features
name | default ? | description |
---|---|---|
send |
yes | Enables SendTypeMap |
sync |
yes | Enables SyncTypeMap |
hashbrown |
no | Enables no_std support |
Dependencies
~0–315KB