Module statemap

Module statemap 

Source
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§

StateMap
StateMap is a HashMap but it preserves order and can only take in new items but not remove them. Once frozen, the StateMap does 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 the StateMap. Then updates can be fetched to the StateMap using StateMap::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 the StateMap to the latest updates.
StateMapModifier
Wraps the StateMap in a temporary structure that doesn’t commit changes to the StateMap

Enums§

StateMapError
StateMapError can describe certain situations that might arise upon doing illegal operations pushing new items to the StateMap after its frozen will trigger in StateMapError::Frozen.

Traits§

StateMapKey
A marker trait that defines what K for StateMap<K, T> should be
StateMapValue
A marker trait that defines what T for StateMap<K, T> should be