Collections
Collections provide a convenient way to work with groups of data. The Sui framework provides several modules that provide collection logic:
bag
A bag is a heterogeneous map-like collection. The collection is similar to sui::table
in that its keys and values are not stored within the Bag value, but instead are stored using Sui's object system. The Bag struct acts only as a handle into the object system to retrieve those keys and values. This means that Bag values with exactly the same key-value mapping will not be equal, with ==, at runtime.
To learn more, see Table and Bag or the framework definition on GitHub.