pub struct LayoutNode {
pub id: ComponentId,
pub style: LayoutStyle,
pub layout: LayoutResult,
pub children: Vec<LayoutNode>,
pub parent_id: Option<ComponentId>,
}
Expand description
A node in the layout tree
Fields§
§id: ComponentId
Unique identifier for this layout node
style: LayoutStyle
Layout style properties
layout: LayoutResult
Computed layout result
children: Vec<LayoutNode>
Child nodes
parent_id: Option<ComponentId>
Parent node ID (if any)
Implementations§
Source§impl LayoutNode
impl LayoutNode
Sourcepub fn new(id: ComponentId, style: LayoutStyle) -> Self
pub fn new(id: ComponentId, style: LayoutStyle) -> Self
Create a new layout node
Sourcepub fn add_child(&mut self, child: LayoutNode)
pub fn add_child(&mut self, child: LayoutNode)
Add a child node
Sourcepub fn remove_child(&mut self, child_id: ComponentId) -> Option<LayoutNode>
pub fn remove_child(&mut self, child_id: ComponentId) -> Option<LayoutNode>
Remove a child node by ID
Sourcepub fn mark_dirty(&mut self)
pub fn mark_dirty(&mut self)
Mark this node and all ancestors as dirty
Sourcepub fn main_axis_size(&self) -> f32
pub fn main_axis_size(&self) -> f32
Get the main axis size based on flex direction
Sourcepub fn cross_axis_size(&self) -> f32
pub fn cross_axis_size(&self) -> f32
Get the cross axis size based on flex direction
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LayoutNode
impl RefUnwindSafe for LayoutNode
impl Send for LayoutNode
impl Sync for LayoutNode
impl Unpin for LayoutNode
impl UnwindSafe for LayoutNode
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