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: TagThe tag of the Tree.
state: State§children: Vec<Tree>The children of the root widget of the Tree.
Implementations§
Source§impl Tree
impl Tree
Sourcepub fn new<'a, Message, Renderer>(
widget: impl Borrow<dyn Widget<Message, Renderer> + 'a>,
) -> Self
pub fn new<'a, Message, Renderer>( widget: impl Borrow<dyn Widget<Message, Renderer> + 'a>, ) -> Self
Creates a new Tree for the provided [Element].
Sourcepub fn diff<'a, Message, Renderer>(
&mut self,
new: impl Borrow<dyn Widget<Message, Renderer> + 'a>,
)
pub fn diff<'a, Message, Renderer>( &mut self, new: impl Borrow<dyn Widget<Message, Renderer> + 'a>, )
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.
Sourcepub fn diff_children<'a, Message, Renderer>(
&mut self,
new_children: &[impl Borrow<dyn Widget<Message, Renderer> + 'a>],
)
pub fn diff_children<'a, Message, Renderer>( &mut self, new_children: &[impl Borrow<dyn Widget<Message, Renderer> + 'a>], )
Reconciliates the children of the tree with the provided list of [Element].
Auto Trait Implementations§
impl Freeze for Tree
impl !RefUnwindSafe for Tree
impl !Send for Tree
impl !Sync for Tree
impl Unpin for Tree
impl !UnwindSafe for Tree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more