Skip to main content

Owner

type Owner

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 Owner struct {
// contains filtered or unexported fields
}

func LiftFromExternalOwner

func LiftFromExternalOwner(handle uint64) *Owner

func OwnerFromBcs

func OwnerFromBcs(bcs []byte) (*Owner, error)

Create this type from BCS encoded bytes.

func OwnerFromJson

func OwnerFromJson(json string) (*Owner, error)

Create this type from JSON encoded string.

func OwnerNewAddress

func OwnerNewAddress(address *Address) *Owner

func OwnerNewImmutable

func OwnerNewImmutable() *Owner

func OwnerNewObject

func OwnerNewObject(id *ObjectId) *Owner

func OwnerNewShared

func OwnerNewShared(version *Version) *Owner

func (*Owner) AddressOrObject

func (_self *Owner) AddressOrObject() **Address

Returns an `Address` if this object is owned by an address or object, and None if it is shared or immutable.

func (*Owner) AsAddress

func (_self *Owner) AsAddress() *Address

Convert this owner into an address owner if it is one, or panic otherwise

func (*Owner) AsObject

func (_self *Owner) AsObject() *ObjectId

Convert this owner into an object owner if it is one, or panic otherwise

func (*Owner) AsOptAddress

func (_self *Owner) AsOptAddress() **Address

Convert this owner into an address owner if it is one, or return `None` otherwise

func (*Owner) AsOptObject

func (_self *Owner) AsOptObject() **ObjectId

Convert this owner into an object owner if it is one, or return `None` otherwise

func (*Owner) AsOptShared

func (_self *Owner) AsOptShared() **Version

Convert this owner into a shared owner if it is one, or return `None` otherwise

func (*Owner) AsShared

func (_self *Owner) AsShared() *Version

Convert this owner into a shared owner if it is one, or panic otherwise

func (*Owner) DebugString

func (_self *Owner) DebugString() string

func (*Owner) Destroy

func (object *Owner) Destroy()

func (*Owner) Eq

func (_self *Owner) Eq(other *Owner) bool

func (*Owner) Hash

func (_self *Owner) Hash() uint64

func (*Owner) IsAddress

func (_self *Owner) IsAddress() bool

Check if this is an address owner

func (*Owner) IsImmutable

func (_self *Owner) IsImmutable() bool

Check if this is an immutable owner

func (*Owner) IsObject

func (_self *Owner) IsObject() bool

Check if this is an object owner

func (*Owner) IsShared

func (_self *Owner) IsShared() bool

Check if this is a shared owner

func (*Owner) Ne

func (_self *Owner) Ne(other *Owner) bool

func (*Owner) String

func (_self *Owner) String() string