This is a continuation of #25. Global can currently only hold one value, but it should be possible to store multiple values. Global should therefore have the ability to "upgrade" its content to an AnyMap if necessary.
This includes adding a set<T>(&mut self, data: T) method that should perform one of the following actions, depending on the state of the Global:
Upgrade Global::None to Global::One with the data set to it.
Replace the old data in Global::One if it has the same type as the new data.
Upgrade Global::One to Global::Many (name may change) if the old value is of an other type than the new value.
This is a continuation of #25.
Global
can currently only hold one value, but it should be possible to store multiple values.Global
should therefore have the ability to "upgrade" its content to anAnyMap
if necessary.This includes adding a
set<T>(&mut self, data: T)
method that should perform one of the following actions, depending on the state of theGlobal
:Global::None
toGlobal::One
with the data set to it.Global::One
if it has the same type as the new data.Global::One
toGlobal::Many
(name may change) if the old value is of an other type than the new value.Global::Many
.