Module mappers

Source

Structs§

AddressToIdMapper
BiDiMapper
A bi-directional map, from values to ids and viceversa. The mapper is based on UnorderedSetMapper, reason why the remove is done by swap_remove
FungibleTokenMapper
LinkedListMapper
LinkedListNode
MapMapper
MapStorageMapper
NonFungibleTokenMapper
OrderedBinaryTreeMapper
OrderedBinaryTreeNode
QueueMapper
A queue with owned nodes.
SetMapper
SingleValue
Intermediary type for deserializing the result of an endpoint that returns a SingleValueMapper.
SingleValueMapper
Manages a single serializable item in storage.
TokenAttributesMapper
UniqueIdMapper
Holds the values from 1 to N with as little storage interaction as possible If Mapper[i] = i, then it stores nothing, i.e. “0” If Mapper[i] is equal to another value, then it stores the value
UnorderedSetMapper
UserMapper
Very widely used mapper, that manages the users of a smart contract. It holds a bi-directional map, from addresses to ids and viceversa. This is so we can easily iterate over all users, using their ids. Also holds the user count in sync. This is also necessary for iteration.
VecMapper
Manages a list of items of the same type. Saves each of the items under a separate key in storage. To produce each individual key, it concatenates the main key with a serialized 4-byte index. Indexes start from 1, instead of 0. (We avoid 0-value indexes to prevent confusion between an uninitialized variable and zero.) It also stores the count separately, at what would be index 0. The count is always kept in sync automatically.
WhitelistMapper
A non-iterable whitelist mapper. Very efficient for storing a whitelist, as each item requires only one storage key. If you need to iterate over the keys, use UnorderedSetMapper or SetMapper instead.

Enums§

TokenMapperState

Constants§

NULL_ID
NULL_NODE_ID

Traits§

StorageClearable
StorageMapper
StorageMapperFromAddress

Type Aliases§

AddressId
NodeId
UniqueId