logo
pub struct Tree {
    pub tag: Tag,
    pub state: State,
    pub children: Vec<Tree>,
}
Expand description

A persistent state widget tree.

A Tree is normally associated with a specific widget in the widget tree.

Fields

tag: Tag

The tag of the Tree.

state: State

The State of the Tree.

children: Vec<Tree>

The children of the root widget of the Tree.

Implementations

Creates an empty, stateless Tree with no children.

Creates a new Tree for the provided Element.

Reconciliates the current tree with the provided Element.

If the tag of the Element matches the tag of the Tree, then the Element proceeds with the reconciliation (i.e. Widget::diff is called).

Otherwise, the whole Tree is recreated.

Reconciliates the children of the tree with the provided list of Element.

Reconciliates the children of the tree with the provided list of Element using custom logic both for diffing and creating new widget state.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.