Skip to content

Polymorphic collections

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

kas-gui/polystore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polystore

Test Status Crate API

A polymorphic data store:

// It's a HashMap<K = i32> storing polymorphic values:
let mut store = HashMap::new();

// k1 is the key 1 tagged with the element type `&'static str`
let k1 = store.insert(1, "A static str");
if let Some(v) = store.get_mut(&k1) {
    *v = "another str";
}
assert_eq!(store.get_tagged(&k1), Some(&"another str"));

// untagged keys work too (relying on type inference, here `String`):
store.insert(2, "A String".to_string());
assert_eq!(store.get(&2), Some(&"A String".to_string()));

assert!(store.contains_key(&k1));
assert!(store.contains_key(&1));
assert!(!store.contains_key(&3));

Crate Features

Optional crate features:

  • fxhash: add FxHashMap using the rustc-hash crate

License

Polystore is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT, and COPYRIGHT for details.

About

Polymorphic collections

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages