sui_framework_sdk

Module object

Source
Expand description

Custom ID and UID impls with better Display.

Structs§

  • An object ID. This is used to reference Sui Objects. This is not guaranteed to be globally unique–anyone can create an ID from a UID or from an object, and ID’s can be freely copied and dropped. Here, the values are not globally unique because there can be multiple values of type ID with the same underlying bytes. For example, object::id(&obj) can be called as many times as you want for a given obj, and each ID value will be identical.
  • Globally unique IDs that define an object’s ID in storage. Any Sui Object, that is a struct with the key ability, must have id: UID as its first field. These are globally unique in the sense that no two values of type UID are ever equal, in other words for any two values id1: UID and id2: UID, id1 != id2. This is a privileged type that can only be derived from a TxContext. UID doesn’t have the drop ability, so deleting a UID requires a call to delete.