Expand description
Custom ID and UID impls with better Display.
Structs§
- ID
- An object ID. This is used to reference Sui Objects.
This is not guaranteed to be globally unique–anyone can create an
IDfrom aUIDor 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 typeIDwith the same underlying bytes. For example,object::id(&obj)can be called as many times as you want for a givenobj, and eachIDvalue will be identical. - IDType
Tag - UID
- Globally unique IDs that define an object’s ID in storage. Any Sui Object, that is a struct
with the
keyability, must haveid: UIDas its first field. These are globally unique in the sense that no two values of typeUIDare ever equal, in other words for any two valuesid1: UIDandid2: UID,id1!=id2. This is a privileged type that can only be derived from aTxContext.UIDdoesn’t have thedropability, so deleting aUIDrequires a call todelete. - UIDType
Tag