3 releases
| 0.1.2 | Oct 5, 2022 |
|---|---|
| 0.1.1 | Oct 5, 2022 |
| 0.1.0 | Oct 5, 2022 |
#2508 in Data structures
10KB
145 lines
Disclaimer: This is intended for internal template use but feel free to use. It is unlikely feature additions will be merged unless we would like to add it ourselves.
This is just a small repository that contains simple macros for creating maps and sets of differing types and backends.
There are three different kinds of backends for HashMaps:
- The
stdbackend - the standardstd::collections::HashMap - The
dashmapbackend -dashmap::DashMap - The
thincollectionsbackend -thincollections::thin_map::ThinMap
The std backend is chosen by default when neither the dashmap feature or
the thincollections feature are enabled. Additionally, the dashmap and
thincollections features are mutually exclusive and a compiler error will
occur if both features are enabled.
This crate defines the following macros:
hmap- AHashMapmacro using one of the specified backends.bmap- ABTreeMapmacro using thestd's implementation.map- A generic map macro that will construct either aHashMap(default) orBTreeMapdepending on feature selection.hset- AHashSetmacro using one of the specified backends.bset- ABTreeSetmacro using thestd's implementation.set- A generic set macro that will construct either aHashSet(default) orBTreeSetdepending on feature selection.
Default map selection can be defined with the map-macro-use-hmap or
map-macro-use-bmap, both are mutually exclusive with eachother.
Default set selection can be defined with the set-macro-use-hset or
set-macro-use-bset, both are mutually exclusive with eachother.
Dependencies
~0–325KB