Trait components::elements::ComponentElement
source · [−]pub trait ComponentElement: Element {
fn build(&self) -> &dyn Widget;
fn forget_child(&self, child: &dyn Element);
fn mount(&self, parent: Option<&dyn Element>, new_slot: Option<Slot>);
fn perform_rebuild();
fn visit_children(&self, visitor: &dyn ElementVisitor);
}
Expand description
Inherited from Element
Required Methods
Subclasses should override this function to actually call the appropriate build function (e.g., StatelessWidget.build or State.build) for their widget.
fn forget_child(&self, child: &dyn Element)
fn forget_child(&self, child: &dyn Element)
Remove the given child from the element’s child list, in preparation for the child being reused elsewhere in the element tree.
Add this element to the tree in the given slot of the given parent.
Calls the StatelessWidget.build method of the StatelessWidget object (for stateless widgets) or the State.build method of the State object (for stateful widgets) and then updates the widget tree.
fn visit_children(&self, visitor: &dyn ElementVisitor)
fn visit_children(&self, visitor: &dyn ElementVisitor)
Calls the argument for each child. Must be overridden by subclasses that support having children.