Expand description
Defines a statemap along with all the trait bounds needed for the keys and values associated.
For an effective StateMap, the key should implement the marker trait
StateMapKey and the value should implement the marker trait StateMapValue.
Structs§
- State
Map StateMapis a HashMap but it preserves order and can only take in new items but not remove them. Once frozen, theStateMapdoes not allow changes and is ready to be used, freezing it calculates a SHA-256 digest of the initial key values, in the process assigning a unique id to theStateMap. Then updates can be fetched to theStateMapusingStateMap::set_update_id. If the update_id is determined to be more than remote’s update capacity, the remote returns a full state update to bring theStateMapto the latest updates.- State
MapModifier - Wraps the
StateMapin a temporary structure that doesn’t commit changes to theStateMap
Enums§
- State
MapError StateMapErrorcan describe certain situations that might arise upon doing illegal operations pushing new items to theStateMapafter its frozen will trigger inStateMapError::Frozen.
Traits§
- State
MapKey - A marker trait that defines what
KforStateMap<K, T>should be - State
MapValue - A marker trait that defines what
TforStateMap<K, T>should be