pub enum Owner {
AddressOwner(Address),
ObjectOwner(ObjectId),
Shared {
initial_shared_version: Version,
},
Immutable,
ConsensusV2 {
start_version: Version,
authenticator: Box<Authenticator>,
},
}Expand description
The entity that owns an object.
Variants§
AddressOwner(Address)
Object is exclusively owned by a single address, and is mutable.
ObjectOwner(ObjectId)
Object is exclusively owned by a single object, and is mutable. The object ID is converted to Address as SuiAddress is universal.
Object is shared, can be used by any address, and is mutable.
Immutable
Object is immutable, and hence ownership doesn’t matter.
ConsensusV2
Object is sequenced via consensus. Ownership is managed by the configured authenticator.
Note: wondering what happened to V1? Shared above was the V1 of consensus objects.
Fields
start_version: VersionThe version at which the object most recently became a consensus object.
This serves the same function as initial_shared_version, except it may change
if the object’s Owner type changes.
authenticator: Box<Authenticator>The authentication mode of the object
Implementations§
Source§impl Owner
impl Owner
Sourcepub const fn get_address_owner_address(&self) -> Option<Address>
pub const fn get_address_owner_address(&self) -> Option<Address>
Only return address of AddressOwner, otherwise return error.
ObjectOwner’s address is converted from object id, thus we will skip it.
Sourcepub const fn get_owner_address(&self) -> Option<Address>
pub const fn get_owner_address(&self) -> Option<Address>
This function will return address of both AddressOwner and ObjectOwner,
Address of ObjectOwner is converted from object id, even though the type is Address.