Struct tuix::Tree[]

pub struct Tree {
    pub parent: Vec<Option<Entity>, Global>,
    pub first_child: Vec<Option<Entity>, Global>,
    pub next_sibling: Vec<Option<Entity>, Global>,
    pub prev_sibling: Vec<Option<Entity>, Global>,
    pub changed: bool,
}
Expand description

The tree describes a tree of entities

Fields

parent: Vec<Option<Entity>, Global>first_child: Vec<Option<Entity>, Global>next_sibling: Vec<Option<Entity>, Global>prev_sibling: Vec<Option<Entity>, Global>changed: bool

Implementations

Creates a new tree with a root entity

Returns the last child of an entity

Returns the nth child of an entity

Returns the number of children of an entity

Returns the parent of an entity

Returns the first child of an entity or None if there isn’t one

Returns the next sibling of an entity or None if there isn’t one

Returns the previous sibling of an entity or None if there isn’t one

Returns true if the entity is the first child of its parent

Returns true if the entity has children

Removes an entity from the tree

This method assumes that a check if the entity is alive has already been done prior to calling this method

Adds an entity to the tree with the specified parent

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

A type respresenting a node in the visual tree

A type representing an iterator that walks down the visual tree

A type respresenting an iterator that walks up the visual tree

A type representing an iterator which iterates through the children of a specified node

Returns an iterator which walks down the hierarchy

Returns an iterator which walks up the hierarchy

Returns an iterator over the child nodes of a specified node

Returns true if the specified node is the first child of its parent

Returns true if the specified node is the last child of its parent

Get the parent node of the specified node

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. 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 alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.