Skip to main content

Class: Owner

Enum of different types of ownership for an object.

BCS

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

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

Extends

  • UniffiAbstractObject

Implements

Properties

[destructorGuardSymbol]

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]

readonly [uniffiTypeNameSymbol]: "Owner" = "Owner";

Methods

addressOrObject()

addressOrObject(): AddressLike | undefined;

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

Returns

AddressLike | undefined

Implementation of

OwnerLike.addressOrObject


asAddress()

asAddress(): AddressLike;

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

Returns

AddressLike

Implementation of

OwnerLike.asAddress


asObject()

asObject(): ObjectIdLike;

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

Returns

ObjectIdLike

Implementation of

OwnerLike.asObject


asOptAddress()

asOptAddress(): AddressLike | undefined;

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

Returns

AddressLike | undefined

Implementation of

OwnerLike.asOptAddress


asOptObject()

asOptObject(): ObjectIdLike | undefined;

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

Returns

ObjectIdLike | undefined

Implementation of

OwnerLike.asOptObject


asOptShared()

asOptShared(): VersionLike | undefined;

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

Returns

VersionLike | undefined

Implementation of

OwnerLike.asOptShared


asShared()

asShared(): VersionLike;

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

Returns

VersionLike

Implementation of

OwnerLike.asShared


equals()

equals(other): boolean;

Parameters

other

Owner

Returns

boolean


hashCode()

hashCode(): bigint;

Returns

bigint


isAddress()

isAddress(): boolean;

Check if this is an address owner

Returns

boolean

Implementation of

OwnerLike.isAddress


isImmutable()

isImmutable(): boolean;

Check if this is an immutable owner

Returns

boolean

Implementation of

OwnerLike.isImmutable


isObject()

isObject(): boolean;

Check if this is an object owner

Returns

boolean

Implementation of

OwnerLike.isObject


isShared()

isShared(): boolean;

Check if this is a shared owner

Returns

boolean

Implementation of

OwnerLike.isShared


toDebugString()

toDebugString(): string;

Returns

string


toString()

toString(): string;

Returns a string representation of an object.

Returns

string


uniffiDestroy()

uniffiDestroy(): void;

Explicitly tell Rust to destroy the native peer that backs this object.

Once this method has been called, any following method calls will throw an error.

Can be called more than once.

Returns

void

Overrides

UniffiAbstractObject.uniffiDestroy

uniffiUse()

uniffiUse<T>(block): T;

A convenience method to use this object, then destroy it after its use.

Type Parameters

T

T

Parameters

block

(obj) => T

Returns

T

Inherited from

UniffiAbstractObject.uniffiUse

instanceOf()

static instanceOf(obj_): obj_ is Owner;

Parameters

obj_

any

Returns

obj_ is Owner


newAddress()

static newAddress(address): OwnerLike;

Parameters

address

AddressLike

Returns

OwnerLike


newImmutable()

static newImmutable(): OwnerLike;

Returns

OwnerLike


newObject()

static newObject(id): OwnerLike;

Parameters

id

ObjectIdLike

Returns

OwnerLike


newShared()

static newShared(version): OwnerLike;

Parameters

version

VersionLike

Returns

OwnerLike