pub struct Element<A> {
pub id: ElementId,
pub widget_id: WidgetId,
pub key: Option<Key>,
pub kind: ElementKind<A>,
pub dirty: DirtyFlags,
pub parent: Option<ElementId>,
pub children: Vec<ElementId>,
pub layout: Option<LayoutResult>,
pub flex_item: FlexItemStyle,
pub size_hint: LayoutSizeHint,
pub layout_debug: Option<LayoutDebugInfo>,
/* private fields */
}Expand description
One node in an super::ElementTree.
Public fields expose retained state for framework integration. Mutating
relationships or layout directly can violate tree/cache invariants; prefer
super::ElementTree methods when available.
§Examples
use ailloli_ui_runtime::element::{ElementKind, ElementTree};
let mut tree = ElementTree::<()>::new();
let id = tree.create_element(ElementKind::Empty, None, None);
let element = tree.get(id).unwrap();
assert_eq!(element.id, id);
assert!(element.dirty.layout && element.layout.is_none());Fields§
§id: ElementIdStable element identity allocated by its tree.
widget_id: WidgetIdStable widget-facing identity allocated alongside the element.
key: Option<Key>Optional reconciliation key; None selects positional matching.
kind: ElementKind<A>Empty, widget, or component payload.
dirty: DirtyFlagsPending layout, paint, and input work.
parent: Option<ElementId>Retained parent ID, or None for a root/detached node.
children: Vec<ElementId>Direct children in layout, paint, hit-test, and reconciliation order.
layout: Option<LayoutResult>Most recent authoritative layout, or None before a committed pass.
flex_item: FlexItemStyleFlex behavior when this element is a direct flex-container child.
size_hint: LayoutSizeHintDeclarative width and height hints used by parent layout.
layout_debug: Option<LayoutDebugInfo>Latest developer-tooling layout record, or None before layout.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Element<A>
impl<A> !RefUnwindSafe for Element<A>
impl<A> !Send for Element<A>
impl<A> !Sync for Element<A>
impl<A> Unpin for Element<A>
impl<A> !UnwindSafe for Element<A>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.