Skip to main content

Owner

type Owner​

Enum of different types of ownership for an object.

BCS​

The BCS serialized form of this type is specified in [`bcs-schema.abnf`](https://github.com/iotaledger/iota-rust-sdk/blob/develop/crates/iota-sdk-types/bcs-schema.abnf\).

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 a 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

func (*Owner) ToBcs​

func (_self *Owner) ToBcs() ([]byte, error)

Convert this type to BCS encoded bytes.

func (*Owner) ToDisplayString​

func (_self *Owner) ToDisplayString() string

Render this type as human-readable text.

Some types also print this through the binding's native string conversion; this method is the spelling every object type has.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

func (*Owner) ToJson​

func (_self *Owner) ToJson() (string, error)

Convert this type to a JSON encoded string.