pub struct Column {
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 vertical flex container that lays out children in a column.
Children are arranged top-to-bottom. Use align_items to control
cross-axis (horizontal) alignment and justify_content for main-axis
(vertical) distribution.
§Example
ⓘ
Column {
children: vec![
Text::new("Title").size(24.0).into_node().into(),
Text::new("Subtitle").size(14.0).into_node().into(),
],
gap: Some(4.0),
align_items: AlignItems::Stretch,
..Default::default()
}Fields§
§id: Option<NodeId>Explicit node identity.
children: Vec<Node>The child widgets laid out top-to-bottom.
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 when they overflow.
align_items: AlignItemsCross-axis (horizontal) alignment (default: Stretch).
justify_content: JustifyContentMain-axis (vertical) distribution (default: Start).
Implementations§
Source§impl Column
impl Column
pub fn children(self, children: Vec<Node>) -> Self
pub fn flex_grow(self, flex_grow: f32) -> Self
pub fn gap(self, gap: Option<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 Column
impl<'de> Deserialize<'de> for Column
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 Column
impl Lower for Column
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 Column
impl !RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnsafeUnpin for Column
impl !UnwindSafe for Column
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.