simple-collection-macros

Crates.iosimple-collection-macros
lib.rssimple-collection-macros
version0.1.2
sourcesrc
created_at2022-10-05 15:47:23.885198
updated_at2022-10-05 15:50:57.327462
descriptionSimple and configurable macros for maps and sets.
homepagehttps://github.com/Authentura/rust-collection-macros
repositoryhttps://github.com/Authentura/rust-collection-macros
max_upload_size
id680607
size11,796
cratesio-owners (github:authentura:cratesio-owners)

documentation

README

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 std backend - the standard std::collections::HashMap
  • The dashmap backend - dashmap::DashMap
  • The thincollections backend - 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 - A HashMap macro using one of the specified backends.
  • bmap - A BTreeMap macro using the std's implementation.
  • map - A generic map macro that will construct either a HashMap (default) or BTreeMap depending on feature selection.
  • hset - A HashSet macro using one of the specified backends.
  • bset - A BTreeSet macro using the std's implementation.
  • set - A generic set macro that will construct either a HashSet (default) or BTreeSet depending 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.

Commit count: 21

cargo fmt