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 aUID
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 typeID
with the same underlying bytes. For example,object::id(&obj)
can be called as many times as you want for a givenobj
, and eachID
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 haveid: UID
as its first field. These are globally unique in the sense that no two values of typeUID
are ever equal, in other words for any two valuesid1: UID
andid2: UID
,id1
!=id2
. This is a privileged type that can only be derived from aTxContext
.UID
doesn’t have thedrop
ability, so deleting aUID
requires a call todelete
.