Crate total_maps

Source
Expand description

Maps where every possible key has an associated value.

Only entries with uncommon values are actually stored in the map; all other keys are presumed to be associated with a common value. The definition of “common” and “uncommon” is determined by the map’s optional Commonality type parameter; if unspecified, the map will use DefaultCommonality, which uses the standard Default trait to provide the common value.

TotalHashMap and TotalBTreeMap are the main data structures provided by this crate.

Re-exports§

pub use self::nonzero::NonZeroBTreeMap;
pub use self::nonzero::NonZeroHashMap;
pub use self::nonzero::ZeroCommonality;
pub use self::btree_map::TotalBTreeMap;
pub use self::empty::EmptyCommonality;
pub use self::hash_map::TotalHashMap;

Modules§

btree_map
Provides TotalBTreeMap, an ordered map in which every possible key has an associated value. Only entries with uncommon values are actually stored in the map; all other keys are presumed to be associated with a common value.
empty
Provides EmptyCommonality, a commonality for collection types where the common value is an empty collection.
hash_map
Provides TotalHashMap, a hash map in which every possible key has an associated value. Only entries with uncommon values are actually stored in the map; all other keys are presumed to be associated with a common value.
nonzero
Maps that only store entries with nonzero values.

Structs§

DefaultCommonality
A commonality based on the Default trait.

Traits§

Commonality
Defines a notion of “common” vs. “uncommon” values for the type V, used to determine which entries are stored in a TotalHashMap or TotalBTreeMap.