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 .

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


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