Skip to main content

Class: Owner

Enum of different types of ownership for an object.

BCS

The BCS serialized form of this type is specified in bcs-schema.abnf.

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


toBcs()​

toBcs(): ArrayBuffer;

Convert this type to BCS encoded bytes.

Returns​

ArrayBuffer

Implementation of​

OwnerLike.toBcs


toDebugString()​

toDebugString(): string;

Returns​

string


toDisplayString()​

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.

Returns​

string

Implementation of​

OwnerLike.toDisplayString


toJson()​

toJson(): string;

Convert this type to a JSON encoded string.

Returns​

string

Implementation of​

OwnerLike.toJson


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


fromBcs()​

static fromBcs(bcs): OwnerLike;

Create this type from BCS encoded bytes.

Parameters​

bcs​

ArrayBuffer

Returns​

OwnerLike


fromJson()​

static fromJson(json): OwnerLike;

Create this type from a JSON encoded string.

Parameters​

json​

string

Returns​

OwnerLike


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