Expand description
This crate provides a safe and convenient store for one value of each type.
Your starting point is Map
. It has an example.
§Cargo features
This crate has two independent features, each of which provides an implementation providing
types Map
, AnyMap
, OccupiedEntry
, VacantEntry
, Entry
and RawMap
:
-
std (default, enabled in this build): an implementation using
std::collections::hash_map
, placed in the crate root (e.g.anymap3::AnyMap
). -
hashbrown (optional; enabled in this build): an implementation using
alloc
andhashbrown::hash_map
, placed in a modulehashbrown
(e.g.anymap3::hashbrown::AnyMap
).
Modules§
- hashbrown
- AnyMap backed by
hashbrown
.
Structs§
- Map
- A collection containing zero or one values for any given type and allowing convenient, type-safe access to those values.
- Occupied
Entry - A view into a single occupied location in an
Map
. - Type
IdHasher - A hasher designed to eke a little more speed out, given
TypeId
’s known characteristics. - Vacant
Entry - A view into a single empty location in an
Map
.
Enums§
- Entry
- A view into a single location in an
Map
, which may be vacant or occupied.