pub enum Node {
Row {
gap: f32,
constraints: Option<Constraints>,
children: Vec<NodeId>,
},
Col {
gap: f32,
constraints: Option<Constraints>,
children: Vec<NodeId>,
},
Panel {
id: PanelId,
kind: Arc<str>,
constraints: Constraints,
},
Grid {
columns: GridColumnMode,
gap: f32,
auto_rows: bool,
children: Vec<NodeId>,
},
GridItemWrapper {
span: CardSpan,
child: NodeId,
},
TaffyPassthrough {
style: Box<Style>,
children: Box<[NodeId]>,
},
}Expand description
Node type in the layout tree arena.
Variants cover flex containers (Row, Col),
CSS Grid (Grid, GridItemWrapper),
leaf panels (Panel), and a raw Taffy escape hatch
(TaffyPassthrough).
Construct trees via LayoutBuilder rather than
creating nodes directly.
Variants§
Row
Horizontal container laying children left-to-right.
Fields
§
constraints: Option<Constraints>Optional constraints for this container as a child.
Col
Vertical container laying children top-to-bottom.
Fields
§
constraints: Option<Constraints>Optional constraints for this container as a child.
Panel
Leaf node representing a single panel.
Fields
§
constraints: ConstraintsSize constraints for this panel.
Grid
CSS Grid container with column mode, gap, and row sizing.
Fields
§
columns: GridColumnModeColumn layout mode (fixed count, auto-fill, or auto-fit).
GridItemWrapper
Wrapper for a grid item that carries a column span.
Fields
TaffyPassthrough
Raw Taffy node for escape-hatch styling.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl !Send for Node
impl !Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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