pub struct ParentData {
pub weight: f32,
pub fill: bool,
pub box_alignment: Option<Alignment>,
pub row_alignment: Option<VerticalAlignment>,
pub row_baseline: bool,
pub column_alignment: Option<HorizontalAlignment>,
pub fill_width_fraction: f32,
pub fill_height_fraction: f32,
pub layout_data: Option<Rc<dyn LayoutData>>,
}Expand description
Layout metadata supplied by a child for its direct parent.
Weight/fill apply to Row and Column. Alignment values override the corresponding parent layout’s default alignment for this child only.
Fields§
§weight: f32The child’s share of a Row’s or Column’s room left over; 0 for none.
fill: boolWhether a weighted child fills its share or may be smaller.
box_alignment: Option<Alignment>Where the child sits in a Box, over the Box’s own alignment.
row_alignment: Option<VerticalAlignment>Where the child sits across a Row, over the Row’s own alignment.
row_baseline: boolAligns this child’s first baseline with other baseline-aligned Row children.
column_alignment: Option<HorizontalAlignment>Where the child sits across a Column, over the Column’s own alignment.
fill_width_fraction: f32The fraction of the parent’s width the child’s outermost horizontal
fill modifier asks for; 0 without one. A FlexBox reads it as the
child’s default grow. Compose’s FillModifierParentData.
fill_height_fraction: f32The same for height.
layout_data: Option<Rc<dyn LayoutData>>The data of the child’s outermost LayoutData modifier, for a
parent that reads it by its type.
Implementations§
Source§impl ParentData
impl ParentData
Sourcepub fn has_weight(&self) -> bool
pub fn has_weight(&self) -> bool
Whether the child takes a share of the room left over.
Sourcepub fn layout_data<T>(&self) -> Option<&T>where
T: Any,
pub fn layout_data<T>(&self) -> Option<&T>where
T: Any,
The child’s LayoutData when it is a T.
Trait Implementations§
Source§impl Clone for ParentData
impl Clone for ParentData
Source§fn clone(&self) -> ParentData
fn clone(&self) -> ParentData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParentData
impl Debug for ParentData
Source§impl Default for ParentData
impl Default for ParentData
Source§fn default() -> ParentData
fn default() -> ParentData
Source§impl From<FlexParentData> for ParentData
impl From<FlexParentData> for ParentData
Source§fn from(value: FlexParentData) -> ParentData
fn from(value: FlexParentData) -> ParentData
Auto Trait Implementations§
impl !RefUnwindSafe for ParentData
impl !Send for ParentData
impl !Sync for ParentData
impl !UnwindSafe for ParentData
impl Freeze for ParentData
impl Unpin for ParentData
impl UnsafeUnpin for ParentData
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more