pub struct AnyElement { /* private fields */ }Expand description
Erased Element: one identity and a static vtable, like AnyRenderObject.
Equality is Dart’s == on an element, which is identity.
Implementations§
Source§impl AnyElement
impl AnyElement
Sourcepub fn downcast<T: Element>(self, app: &App) -> Option<Handle<T>>
pub fn downcast<T: Element>(self, app: &App) -> Option<Handle<T>>
Dart’s element as T: the typed handle when this element is a T, else None.
Sourcepub fn widget(self, app: &App) -> &WidgetRef
pub fn widget(self, app: &App) -> &WidgetRef
The configuration for this element.
Avoid overriding this field on Element subtypes.
Sourcepub fn mounted(self, app: &App) -> bool
pub fn mounted(self, app: &App) -> bool
Returns true if the Element is active.
A defunct element is freed after its unmount; a handle kept past that, as a callback
keeps its BuildContext, answers false.
Sourcepub fn parent(self, app: &App) -> Option<AnyElement>
pub fn parent(self, app: &App) -> Option<AnyElement>
The parent of this element, or None at the root.
Sourcepub fn slot(self, app: &App) -> Option<Slot>
pub fn slot(self, app: &App) -> Option<Slot>
Information set by parent to define where this child fits in its parent’s child list.
Sourcepub fn depth(self, app: &App) -> u32
pub fn depth(self, app: &App) -> u32
An integer that is guaranteed to be greater than the parent’s, if any. The element at the root of the tree must have a depth greater than 0.
Sourcepub fn owner(self, app: &App) -> Option<Handle<BuildOwner>>
pub fn owner(self, app: &App) -> Option<Handle<BuildOwner>>
The object that manages the lifecycle of this element.
Sourcepub fn build_scope(self, app: &App) -> Handle<BuildScope>
pub fn build_scope(self, app: &App) -> Handle<BuildScope>
The BuildScope whose dirty list this element is in.
Sourcepub fn lifecycle(self, app: &App) -> ElementLifecycle
pub fn lifecycle(self, app: &App) -> ElementLifecycle
Where this element is in its lifecycle; a freed element is defunct.
Sourcepub fn to_string_short(self, app: &App) -> String
pub fn to_string_short(self, app: &App) -> String
Dart’s toStringShort: the widget’s, or the element’s identity once it has none.
Sourcepub fn to_diagnostics_node(
self,
app: &App,
name: impl IntoPropertyName,
) -> ElementDiagnosticsNode
pub fn to_diagnostics_node( self, app: &App, name: impl IntoPropertyName, ) -> ElementDiagnosticsNode
Dart’s toDiagnosticsNode(name:): a snapshot of this element and its descendants as a
dump shows them, one line each in the dense style.
Sourcepub fn to_string_deep(self, app: &App) -> String
pub fn to_string_deep(self, app: &App) -> String
Dart’s Element.toStringDeep: this element and its descendants, at Dart’s default level
(debug) and width.
Sourcepub fn to_string_deep_with(
self,
app: &App,
min_level: DiagnosticLevel,
wrap_width: usize,
) -> String
pub fn to_string_deep_with( self, app: &App, min_level: DiagnosticLevel, wrap_width: usize, ) -> String
to_string_deep showing only properties at min_level or
above, wrapping a line at wrap_width characters.
Sourcepub fn debug_is_active(self, app: &App) -> bool
pub fn debug_is_active(self, app: &App) -> bool
Whether the element is active (in the tree).
Sourcepub fn debug_is_defunct(self, app: &App) -> bool
pub fn debug_is_defunct(self, app: &App) -> bool
Whether the element is defunct (unmounted).
Sourcepub fn dirty(self, app: &App) -> bool
pub fn dirty(self, app: &App) -> bool
Returns true if the element has been marked as needing rebuilding.
The flag is true when the element is first created and after
mark_needs_build has been called. The flag is reset to
false in the perform_rebuild implementation.
Sourcepub fn debug_doing_build(self, app: &App) -> bool
pub fn debug_doing_build(self, app: &App) -> bool
Whether this element is in the middle of building.
Sourcepub fn children(self, app: &App) -> Vec<AnyElement>
pub fn children(self, app: &App) -> Vec<AnyElement>
The children, in visit order.
Sourcepub fn visit_children(self, app: &App, visitor: &mut dyn FnMut(AnyElement))
pub fn visit_children(self, app: &App, visitor: &mut dyn FnMut(AnyElement))
Sourcepub fn debug_visit_onstage_children(
self,
app: &App,
visitor: &mut dyn FnMut(AnyElement),
)
pub fn debug_visit_onstage_children( self, app: &App, visitor: &mut dyn FnMut(AnyElement), )
Sourcepub fn descendants(self, app: &App, skip_offstage: bool) -> Vec<AnyElement>
pub fn descendants(self, app: &App, skip_offstage: bool) -> Vec<AnyElement>
Every element under this one, depth first with a parent before its children and siblings
in order, without this one, and with skip_offstage only those onstage: Dart’s
collectAllElementsFrom.
Sourcepub fn render_object_attaching_child(self, app: &App) -> Option<AnyElement>
pub fn render_object_attaching_child(self, app: &App) -> Option<AnyElement>
Sourcepub fn mount(
self,
app: &mut App,
parent: Option<AnyElement>,
new_slot: Option<Slot>,
)
pub fn mount( self, app: &mut App, parent: Option<AnyElement>, new_slot: Option<Slot>, )
See Element::mount.
Sourcepub fn update(self, app: &mut App, new_widget: WidgetRef)
pub fn update(self, app: &mut App, new_widget: WidgetRef)
See Element::update.
Sourcepub fn update_slot(self, app: &mut App, new_slot: Option<Slot>)
pub fn update_slot(self, app: &mut App, new_slot: Option<Slot>)
See Element::update_slot.
Sourcepub fn attach_render_object(self, app: &mut App, new_slot: Option<Slot>)
pub fn attach_render_object(self, app: &mut App, new_slot: Option<Slot>)
Sourcepub fn detach_render_object(self, app: &mut App)
pub fn detach_render_object(self, app: &mut App)
Sourcepub fn forget_child(self, app: &mut App, child: AnyElement)
pub fn forget_child(self, app: &mut App, child: AnyElement)
Sourcepub fn activate(self, app: &mut App)
pub fn activate(self, app: &mut App)
See Element::activate.
Sourcepub fn deactivate(self, app: &mut App)
pub fn deactivate(self, app: &mut App)
See Element::deactivate.
Sourcepub fn debug_deactivated(self, app: &mut App)
pub fn debug_deactivated(self, app: &mut App)
Sourcepub fn unmount(self, app: &mut App)
pub fn unmount(self, app: &mut App)
See Element::unmount.
Sourcepub fn perform_rebuild(self, app: &mut App)
pub fn perform_rebuild(self, app: &mut App)
Sourcepub fn did_change_dependencies(self, app: &mut App)
pub fn did_change_dependencies(self, app: &mut App)
Sourcepub fn update_inheritance(self, app: &mut App)
pub fn update_inheritance(self, app: &mut App)
Sourcepub fn attach_notification_tree(self, app: &mut App)
pub fn attach_notification_tree(self, app: &mut App)
Sourcepub fn on_notification(
self,
app: &mut App,
notification: &dyn Notification,
) -> bool
pub fn on_notification( self, app: &mut App, notification: &dyn Notification, ) -> bool
Sourcepub fn dispatch_notification(
self,
app: &mut App,
notification: &dyn Notification,
)
pub fn dispatch_notification( self, app: &mut App, notification: &dyn Notification, )
Start bubbling this notification at the given build context.
The notification will be delivered to any NotificationListener widgets with the
appropriate type parameters that are ancestors of the given BuildContext.
Sourcepub fn render_object(self, app: &App) -> Option<AnyRenderObject>
pub fn render_object(self, app: &App) -> Option<AnyRenderObject>
The render object at (or below) this location in the tree.
If this object is a RenderObjectElement, the render object is the one at this
location in the tree. Otherwise, this getter will walk down the tree until it finds a
RenderObjectElement.
Some locations in the tree are not backed by a render object. In those cases, this
getter returns None.
Sourcepub fn inflate_widget(
self,
app: &mut App,
new_widget: WidgetRef,
new_slot: Option<Slot>,
) -> AnyElement
pub fn inflate_widget( self, app: &mut App, new_widget: WidgetRef, new_slot: Option<Slot>, ) -> AnyElement
Element.inflateWidget: create an element for the given widget and add it as a child of
this element in the given slot.
Sourcepub fn is_render_object_element(self) -> bool
pub fn is_render_object_element(self) -> bool
Dart’s this is RenderObjectElement.
Sourcepub fn insert_render_object_child(
self,
app: &mut App,
child: AnyRenderObject,
slot: Option<Slot>,
)
pub fn insert_render_object_child( self, app: &mut App, child: AnyRenderObject, slot: Option<Slot>, )
Sourcepub fn move_render_object_child(
self,
app: &mut App,
child: AnyRenderObject,
old_slot: Option<Slot>,
new_slot: Option<Slot>,
)
pub fn move_render_object_child( self, app: &mut App, child: AnyRenderObject, old_slot: Option<Slot>, new_slot: Option<Slot>, )
Sourcepub fn remove_render_object_child(
self,
app: &mut App,
child: AnyRenderObject,
slot: Option<Slot>,
)
pub fn remove_render_object_child( self, app: &mut App, child: AnyRenderObject, slot: Option<Slot>, )
Sourcepub fn update_parent_data(self, app: &mut App, parent_data_element: AnyElement)
pub fn update_parent_data(self, app: &mut App, parent_data_element: AnyElement)
Sourcepub fn is_parent_data_element(self) -> bool
pub fn is_parent_data_element(self) -> bool
Dart’s this is ParentDataElement.
Sourcepub fn apply_parent_data(
self,
app: &mut App,
render_object: AnyRenderObject,
) -> bool
pub fn apply_parent_data( self, app: &mut App, render_object: AnyRenderObject, ) -> bool
Sourcepub fn is_inherited_element(self) -> bool
pub fn is_inherited_element(self) -> bool
Dart’s this is InheritedElement.
Sourcepub fn update_dependencies(
self,
app: &mut App,
dependent: AnyElement,
aspect: Option<Rc<dyn Any>>,
)
pub fn update_dependencies( self, app: &mut App, dependent: AnyElement, aspect: Option<Rc<dyn Any>>, )
Sourcepub fn remove_dependent(self, app: &mut App, dependent: AnyElement)
pub fn remove_dependent(self, app: &mut App, dependent: AnyElement)
Sourcepub fn state_handle<S: State>(self, app: &App) -> Option<Handle<S>>
pub fn state_handle<S: State>(self, app: &App) -> Option<Handle<S>>
The typed state handle when this is a StatefulElement whose state is an S.
Sourcepub fn update_child(
self,
app: &mut App,
child: Option<AnyElement>,
new_widget: Option<WidgetRef>,
new_slot: Option<Slot>,
) -> Option<AnyElement>
pub fn update_child( self, app: &mut App, child: Option<AnyElement>, new_widget: Option<WidgetRef>, new_slot: Option<Slot>, ) -> Option<AnyElement>
Update the given child with the given new configuration.
This method is the core of the widgets system. It is called each time we are to add, update, or remove a child based on an updated configuration.
The new_slot argument specifies the new value for this element’s
slot.
If the child is None, and the new_widget is not None, then we have a new child
for which we need to create an Element, configured with new_widget.
If the new_widget is None, and the child is not None, then we need to remove
it because it no longer has a configuration.
If neither are None, then we need to update the child’s configuration to be the
new configuration given by new_widget. If new_widget can be given to the existing
child (as determined by can_update), then it is so given. Otherwise, the old child
needs to be disposed and a new child created for the new configuration.
If both are None, then we don’t have a child and won’t have a child, so we do
nothing.
The update_child method returns the new child, if it had to
create one, or the child that was passed in, if it just had to update the child, or
None, if it removed the child and did not replace it.
Sourcepub fn update_children(
self,
app: &mut App,
old_children: &[AnyElement],
new_widgets: &[WidgetRef],
forgotten_children: Option<ForgottenChildren<'_>>,
slots: Option<&[Option<Slot>]>,
) -> Vec<AnyElement>
pub fn update_children( self, app: &mut App, old_children: &[AnyElement], new_widgets: &[WidgetRef], forgotten_children: Option<ForgottenChildren<'_>>, slots: Option<&[Option<Slot>]>, ) -> Vec<AnyElement>
Updates the children of this element to use new widgets.
Attempts to update the given old children list using the given new widgets, removing obsolete elements and introducing new ones as necessary, and then returns the new child list.
During this function the old_children list must not be modified. If the caller
wishes to remove elements from old_children reentrantly while this function is on
the stack, the caller can supply a forgotten_children argument, which can be
modified while this function is on the stack. Whenever this function reads from
old_children, this function first checks whether the child is in
forgotten_children. If it is, the function acts as if the child was not in
old_children.
forgotten_children is a predicate so that it reads the caller’s set live (in the
arena, where a reentrant forget_child writes it) rather than a snapshot.
This function is a convenience wrapper around update_child,
which updates each individual child. If slots is non-None, the value for the
new_slot argument of update_child is retrieved from that
list using the index that the currently processed child corresponds to in the
new_widgets list (new_widgets and slots must have the same length). If slots
is None, an IndexedSlot is used as the value for the new_slot argument. In
that case, IndexedSlot::index is set to the index that the currently processed
child corresponds to in the new_widgets list and IndexedSlot::value is set to
the Element of the previous widget in that list (or None if it is the first
child).
Sourcepub fn update_slot_for_child(
self,
app: &mut App,
child: AnyElement,
new_slot: Option<Slot>,
)
pub fn update_slot_for_child( self, app: &mut App, child: AnyElement, new_slot: Option<Slot>, )
Change the slot that the given child occupies in its parent.
Called by MultiChildRenderObjectElement, and other RenderObjectElement subclasses
that have multiple children, when child moves from one position to another in this
element’s child list.
Sourcepub fn deactivate_child(self, app: &mut App, child: AnyElement)
pub fn deactivate_child(self, app: &mut App, child: AnyElement)
Move the given element to the list of inactive elements and detach its render object from the render tree.
This method stops the given element from being a child of this element by detaching its render object from the render tree and moving the element to the list of inactive elements.
This method (indirectly) calls deactivate on the child.
The caller is responsible for removing the child from its child model. Typically
deactivate_child is called by the element itself while it
is updating its child model; however, during
GlobalKey reparenting, the new parent proactively calls the old parent’s
deactivate_child, first using forget_child
to cause the old parent to update its child model.
Sourcepub fn find_render_object(self, app: &App) -> Option<AnyRenderObject>
pub fn find_render_object(self, app: &App) -> Option<AnyRenderObject>
The current RenderObject for the widget. If the widget is a RenderObjectWidget,
this is the render object that the widget created for itself. Otherwise, it is the
render object of the first descendant RenderObjectWidget.
This method will only return a valid result after the build phase is complete. It is
therefore not valid to call this from a build method. It should only be called from
interaction event handlers (e.g. gesture callbacks) or layout or paint callbacks. It
is also not valid to call if mounted is false.
Sourcepub fn size(self, app: &App) -> Option<Size>
pub fn size(self, app: &App) -> Option<Size>
The size of the RenderBox returned by find_render_object.
This getter will only return a valid result after the layout phase is complete. It is therefore not valid to call this from a build method. It should only be called from paint callbacks or interaction event handlers (e.g. gesture callbacks).
This getter will only return a valid result if find_render_object
actually returns a RenderBox. If find_render_object
returns a render object that is not a subtype of RenderBox (e.g., RenderView),
this getter will return None.
Sourcepub fn does_depend_on_inherited_element(
self,
app: &App,
ancestor: AnyElement,
) -> bool
pub fn does_depend_on_inherited_element( self, app: &App, ancestor: AnyElement, ) -> bool
Returns true if ancestor is a dependency of this element.
Sourcepub fn depend_on_inherited_element(
self,
app: &mut App,
ancestor: AnyElement,
aspect: Option<Rc<dyn Any>>,
) -> WidgetRef
pub fn depend_on_inherited_element( self, app: &mut App, ancestor: AnyElement, aspect: Option<Rc<dyn Any>>, ) -> WidgetRef
Registers this build context with ancestor such that when ancestor’s widget
changes this build context is rebuilt.
Returns ancestor.widget.
This method is rarely called directly. Most applications should use
depend_on_inherited_widget_of_exact_type,
which calls this method after finding the appropriate InheritedElement ancestor.
Sourcepub fn depend_on_inherited_widget_of_exact_type<W: InheritedWidget>(
self,
app: &mut App,
) -> Option<&W>
pub fn depend_on_inherited_widget_of_exact_type<W: InheritedWidget>( self, app: &mut App, ) -> Option<&W>
Returns the nearest widget of the given type W and creates a dependency on it, or
None if no appropriate widget is found.
The widget found will be a concrete InheritedWidget subclass, and calling this
method registers this build context with the returned widget. When that widget
changes (or a new widget of that type is introduced, or the widget goes away), this
build context is rebuilt so that it can obtain new values from that widget.
This is typically called implicitly from of() static methods, e.g. Theme.of.
This method should not be called from widget constructors or from
State::init_state methods, because those methods would not get called again if the
inherited value were to change. To ensure that the widget correctly updates itself
when the inherited value changes, only call this (directly or indirectly) from build
methods, layout and paint callbacks, or from State::did_change_dependencies.
Sourcepub fn depend_on_inherited_widget_of_exact_type_with_aspect<W: InheritedWidget>(
self,
app: &mut App,
aspect: Option<Rc<dyn Any>>,
) -> Option<&W>
pub fn depend_on_inherited_widget_of_exact_type_with_aspect<W: InheritedWidget>( self, app: &mut App, aspect: Option<Rc<dyn Any>>, ) -> Option<&W>
depend_on_inherited_widget_of_exact_type
with Dart’s aspect argument, for InheritedModel.
Sourcepub fn get_inherited_widget_of_exact_type<W: InheritedWidget>(
self,
app: &App,
) -> Option<&W>
pub fn get_inherited_widget_of_exact_type<W: InheritedWidget>( self, app: &App, ) -> Option<&W>
Returns the nearest widget of the given InheritedWidget subclass W or None if
an appropriate ancestor is not found.
This method does not introduce a dependency the way that the more typical
depend_on_inherited_widget_of_exact_type
does, so this context will not be rebuilt if the InheritedWidget changes. This
function is meant for those uncommon use cases where a dependency is undesirable.
Sourcepub fn get_element_for_inherited_widget_of_exact_type<W: InheritedWidget>(
self,
app: &App,
) -> Option<AnyElement>
pub fn get_element_for_inherited_widget_of_exact_type<W: InheritedWidget>( self, app: &App, ) -> Option<AnyElement>
Obtains the element corresponding to the nearest widget of the given type W, which
must be the type of a concrete InheritedWidget subclass.
Returns None if no such element is found.
Calling this method is O(1) with a small constant factor.
This method does not establish a relationship with the target in the way that
depend_on_inherited_widget_of_exact_type
does.
Sourcepub fn find_ancestor_widget_of_exact_type<W: 'static>(
self,
app: &App,
) -> Option<&W>
pub fn find_ancestor_widget_of_exact_type<W: 'static>( self, app: &App, ) -> Option<&W>
Returns the nearest ancestor widget of the given type W, which must be the type of
a concrete Widget subclass.
In general, depend_on_inherited_widget_of_exact_type
is more useful, since inherited widgets will trigger consumers to rebuild when they
change. This method is appropriate when used in interaction event handlers (e.g.
gesture callbacks) or for performing one-off tasks such as asserting that you have or
don’t have a widget of a specific type as an ancestor. The return value of a Widget’s
build method should not depend on the value returned by this method, because the
build context will not rebuild if the return value of this method changes. This could
lead to a situation where data used in the build method changes, but the widget is
not rebuilt.
Calling this method is relatively expensive (O(N) in the depth of the tree). Only call this method if the distance from this widget to the desired ancestor is known to be small and bounded.
Sourcepub fn find_ancestor_state_of_type<S: State>(
self,
app: &App,
) -> Option<Handle<S>>
pub fn find_ancestor_state_of_type<S: State>( self, app: &App, ) -> Option<Handle<S>>
Returns the State object of the nearest ancestor StatefulWidget widget that is
an instance of the given type S.
This should not be used from build methods, because the build context will not be
rebuilt if the value that would be returned by this method changes. In general,
depend_on_inherited_widget_of_exact_type
is more appropriate for such cases. This method is useful for changing the state of an
ancestor widget in a one-off manner, for example, to cause an ancestor scrolling list
to scroll this build context’s widget into view, or to move the focus in response to
user interaction.
Calling this method is relatively expensive (O(N) in the depth of the tree). Only call this method if the distance from this widget to the desired ancestor is known to be small and bounded.
Sourcepub fn find_root_ancestor_state_of_type<S: State>(
self,
app: &App,
) -> Option<Handle<S>>
pub fn find_root_ancestor_state_of_type<S: State>( self, app: &App, ) -> Option<Handle<S>>
Returns the State object of the furthest ancestor StatefulWidget widget that is
an instance of the given type S.
Functions the same way as find_ancestor_state_of_type
but keeps visiting subsequent ancestors until there are none of the type instance of
S remaining. Then returns the last one found.
This operation is O(N) as well though N is the entire widget tree rather than a subtree.
Sourcepub fn find_ancestor_render_object_of_type<R: RenderObject>(
self,
app: &App,
) -> Option<RenderHandle<R>>
pub fn find_ancestor_render_object_of_type<R: RenderObject>( self, app: &App, ) -> Option<RenderHandle<R>>
Returns the RenderObject object of the nearest ancestor RenderObjectWidget widget
that is an instance of the given type R.
This should not be used from build methods, because the build context will not be
rebuilt if the value that would be returned by this method changes. In general,
depend_on_inherited_widget_of_exact_type
is more appropriate for such cases. This method is useful only in esoteric cases where
a widget needs to cause an ancestor to change its layout or paint behavior. For
example, it is used by Material so that InkWell widgets can trigger the ink splash
on the Material’s actual render object.
Calling this method is relatively expensive (O(N) in the depth of the tree). Only call this method if the distance from this widget to the desired ancestor is known to be small and bounded.
Sourcepub fn visit_ancestor_elements(
self,
app: &App,
visitor: &mut dyn FnMut(AnyElement) -> bool,
)
pub fn visit_ancestor_elements( self, app: &App, visitor: &mut dyn FnMut(AnyElement) -> bool, )
Walks the ancestor chain, starting with the parent of this build context’s widget, invoking the argument for each ancestor.
The callback is given a reference to the ancestor widget’s corresponding Element
object. The walk stops when it reaches the root widget or when the callback returns
false. The callback must not return None.
This is useful for inspecting the widget tree.
Calling this method is relatively expensive (O(N) in the depth of the tree).
Sourcepub fn visit_child_elements(
self,
app: &App,
visitor: &mut dyn FnMut(AnyElement),
)
pub fn visit_child_elements( self, app: &App, visitor: &mut dyn FnMut(AnyElement), )
Walks the children of this widget.
This is useful for applying changes to children after they are built without waiting
for the next frame, especially if the children are known, and especially if there is
exactly one child (as is always the case for StatefulWidgets or StatelessWidgets).
Calling this method is very cheap for build contexts that correspond to
StatefulWidgets or StatelessWidgets (O(1), since there’s only one child).
Calling this method is potentially expensive for build contexts that correspond to
RenderObjectWidgets (O(N) in the number of children).
Calling this method recursively is extremely expensive (O(N) in the number of
descendants), and should be avoided if possible. Generally it is significantly cheaper
to use an InheritedWidget and have the descendants pull data down than it is to use
visit_child_elements recursively to push data down to
them.
Sourcepub fn debug_is_descendant_of(self, app: &App, target: AnyElement) -> bool
pub fn debug_is_descendant_of(self, app: &App, target: AnyElement) -> bool
Dart’s _debugIsDescendantOf.
Sourcepub fn mark_needs_build(self, app: &mut App)
pub fn mark_needs_build(self, app: &mut App)
Marks the element as dirty and adds it to the global list of widgets to rebuild in the next frame.
Since it is inefficient to build an element twice in one frame, applications and widgets should be structured so as to only mark widgets dirty during event handlers before the frame begins, not during the build itself.
Sourcepub fn rebuild(self, app: &mut App, force: bool)
pub fn rebuild(self, app: &mut App, force: bool)
Cause the widget to update itself. In debug builds, also verify various invariants.
Called by the BuildOwner when BuildOwner::schedule_build_for has been called to
mark this element dirty, by mount when the element is first built,
and by update when the widget has changed.
The method will only rebuild if dirty is true. To rebuild
irrespective of the dirty flag, set force to true. Forcing a
rebuild is convenient when update is called, during which
dirty is false.
Sourcepub fn notification_tree(self, app: &App) -> Option<Rc<NotificationNode>>
pub fn notification_tree(self, app: &App) -> Option<Rc<NotificationNode>>
The notification chain this element dispatches into.
Sourcepub fn set_notification_tree(
self,
app: &mut App,
tree: Option<Rc<NotificationNode>>,
)
pub fn set_notification_tree( self, app: &mut App, tree: Option<Rc<NotificationNode>>, )
Sets the notification chain: a notifiable element chains a node for itself here.
Sourcepub fn assign_owner(self, app: &mut App, owner: Handle<BuildOwner>)
pub fn assign_owner(self, app: &mut App, owner: Handle<BuildOwner>)
RootElementMixin.assignOwner: set the owner of the element and its build scope.
The owner of an element is determined at mount, so this should only be called on a root element that is about to be mounted without a parent.
Trait Implementations§
Source§impl Clone for AnyElement
impl Clone for AnyElement
impl Copy for AnyElement
Source§impl Debug for AnyElement
impl Debug for AnyElement
impl Eq for AnyElement
Source§impl Hash for AnyElement
impl Hash for AnyElement
Auto Trait Implementations§
impl Forget for AnyElement
impl Freeze for AnyElement
impl Move for AnyElement
impl RefUnwindSafe for AnyElement
impl Send for AnyElement
impl Sync for AnyElement
impl Unpin for AnyElement
impl UnsafeUnpin for AnyElementwhere
NonZeroU32Inner: UnsafeUnpin,
&'static ElementVTable: UnsafeUnpin,
impl UnwindSafe for AnyElement
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.