Struct tui_realm_treeview::Node[][src]

pub struct Node { /* fields omitted */ }
Expand description

Node

Describes a node inside the Tree

Implementations

new

Instantiates a new Node ATTENTION: id mustn’t be empty nor duplicated

id

Get reference to id

label

Get reference to label

with_children

Sets Node children

with_child

Create a new child in this Node

add_child

Add a child to the node

clear

Clear node children

truncate

Truncate tree at depth. If depth is 0, node’s children will be cleared

is_leaf

Returns whether this node is a leaf (which means it has no children)

query

Search for id inside Node’s children (or is itself)

count

Count items in tree

depth

Calculate the maximum depth of the tree

parent

Get parent node of id

siblings

Get siblings for provided node

node_by_route

Given a vector of indexes, returns the node associated to the route

route_by_node

Calculate the route of a node by its id

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.