Skip to main content

OwnerInterface

type OwnerInterface

Enum of different types of ownership for an object.

BCS

The BCS serialized form for this type is defined by the following ABNF:

```text owner = owner-address / owner-object / owner-shared / owner-immutable

owner-address = %d00 address owner-object = %d01 object-id owner-shared = %d02 u64 owner-immutable = %d03 ```

type OwnerInterface interface {
// Returns an `Address` if this object is owned by an address or
// object, and None if it is shared or immutable.
AddressOrObject() **Address
// Convert this owner into an address owner if it is one, or panic
// otherwise
AsAddress() *Address
// Convert this owner into an object owner if it is one, or panic otherwise
AsObject() *ObjectId
// Convert this owner into an address owner if it is one, or return `None`
// otherwise
AsOptAddress() **Address
// Convert this owner into an object owner if it is one, or return `None`
// otherwise
AsOptObject() **ObjectId
// Convert this owner into a shared owner if it is one, or return `None`
// otherwise
AsOptShared() **Version
// Convert this owner into a shared owner if it is one, or panic otherwise
AsShared() *Version
// Check if this is an address owner
IsAddress() bool
// Check if this is an immutable owner
IsImmutable() bool
// Check if this is an object owner
IsObject() bool
// Check if this is a shared owner
IsShared() bool
}