Skip to main content

Class: Name

Extends​

  • UniffiAbstractObject

Implements​

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

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

Methods​

equals()​

equals(other): boolean;

Parameters​

other​

Name

Returns​

boolean


format()​

format(format): string;

Formats a name into a string based on the available output formats. The default separator is .

A name decoded from BCS is not validated. One without a second-level name or with a top-level name other than iota has no AT form and is formatted in the DOT format.

Parameters​

format​

NameFormat

Returns​

string

Implementation of​

NameLike.format


hashCode()​

hashCode(): bigint;

Returns​

bigint


isSln()​

isSln(): boolean;

Returns whether this name is a second-level name (Ex. test.iota)

Returns​

boolean

Implementation of​

NameLike.isSln


isSubname()​

isSubname(): boolean;

Returns whether this name is a subname (Ex. sub.test.iota)

Returns​

boolean

Implementation of​

NameLike.isSubname


label()​

label(index): string | undefined;

Get the label at the given index

Parameters​

index​

number

Returns​

string | undefined

Implementation of​

NameLike.label


labels()​

labels(): string[];

Get all of the labels. NOTE: These are in reverse order starting with the top-level name and proceeding to subnames.

Returns​

string[]

Implementation of​

NameLike.labels


numLabels()​

numLabels(): number;

Returns the number of labels including TLN.

Returns​

number

Implementation of​

NameLike.numLabels


parent()​

parent(): NameLike | undefined;

parents; second-level names return None.

Returns​

NameLike | undefined

Implementation of​

NameLike.parent


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​

NameLike.toDisplayString


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


fromStr()​

static fromStr(s): NameLike;

Parameters​

s​

string

Returns​

NameLike


instanceOf()​

static instanceOf(obj_): obj_ is Name;

Parameters​

obj_​

any

Returns​

obj_ is Name