pub struct Row {
pub id: Option<NodeId>,
pub children: Vec<Node>,
pub semantics: Option<Semantics>,
pub flex_grow: f32,
pub flex_shrink: f32,
pub gap: Option<f32>,
pub wrap: FlexWrap,
pub align_items: AlignItems,
pub justify_content: JustifyContent,
}Expand description
A horizontal flex container that lays out children in a row.
Children are arranged left-to-right (in LTR locales). Use align_items to
control cross-axis (vertical) alignment and justify_content for main-axis
(horizontal) distribution.
§Example
ⓘ
Row {
children: vec![
Icon::path("M12 2L2 22h20L12 2z").into_node().into(),
Text::new("Warning").into_node().into(),
],
gap: Some(8.0),
align_items: AlignItems::Center,
justify_content: JustifyContent::Start,
..Default::default()
}Fields§
§id: Option<NodeId>Explicit node identity.
children: Vec<Node>The child widgets laid out left-to-right.
semantics: Option<Semantics>Custom semantics for accessibility.
flex_grow: f32Flex grow factor.
flex_shrink: f32Flex shrink factor.
gap: Option<f32>Spacing between children in layout points.
wrap: FlexWrapWhether children wrap to a new line when they overflow.
align_items: AlignItemsCross-axis (vertical) alignment of children (default: Center).
justify_content: JustifyContentMain-axis (horizontal) distribution of children (default: Start).
Implementations§
Source§impl Row
impl Row
pub fn children(self, children: Vec<Node>) -> Self
pub fn flex_grow(self, flex_grow: f32) -> Self
pub fn gap(self, gap: f32) -> Self
pub fn align_items(self, align: AlignItems) -> Self
pub fn justify_content(self, justify: JustifyContent) -> Self
pub fn into_node(self) -> Node
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Row
impl<'de> Deserialize<'de> for Row
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Lower for Row
impl Lower for Row
Source§fn lower(&self, cx: &mut LoweringContext<'_>) -> NodeId
fn lower(&self, cx: &mut LoweringContext<'_>) -> NodeId
Lower this widget into the IR, returning the root node id.
Auto Trait Implementations§
impl Freeze for Row
impl !RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnsafeUnpin for Row
impl !UnwindSafe for Row
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.