struct FlexItem<'a> {Show 16 fields
box_: &'a FlexItemBox,
content_cross_sizes: Sizes,
padding: FlexRelativeSides<Au>,
border: FlexRelativeSides<Au>,
margin: FlexRelativeSides<AuOrAuto>,
pbm_auto_is_zero: FlexRelativeVec2<Au>,
flex_base_size: Au,
flex_base_size_is_definite: bool,
hypothetical_main_size: Au,
content_min_main_size: Au,
content_max_main_size: Option<Au>,
align_self: T,
depends_on_block_constraints: bool,
preferred_aspect_ratio: Option<AspectRatio>,
automatic_cross_size: Size<Au>,
automatic_cross_size_for_intrinsic_sizing: Size<Au>,
}
Expand description
A flex item with some intermediate results
Fields§
§box_: &'a FlexItemBox
§content_cross_sizes: Sizes
The preferred, min and max inner cross sizes.
padding: FlexRelativeSides<Au>
§border: FlexRelativeSides<Au>
§margin: FlexRelativeSides<AuOrAuto>
§pbm_auto_is_zero: FlexRelativeVec2<Au>
Sum of padding, border, and margin (with auto
assumed to be zero) in each axis.
This is the difference between an outer and inner size.
flex_base_size: Au
§flex_base_size_is_definite: bool
Whether the Self::flex_base_size
comes from a definite flex-basis
.
If false and the container main size is also indefinite, percentages in the item’s
content that resolve against its main size should be indefinite.
hypothetical_main_size: Au
§content_min_main_size: Au
The used min main size of the flex item. https://drafts.csswg.org/css-flexbox/#min-main-size-property
content_max_main_size: Option<Au>
The used max main size of the flex item. https://drafts.csswg.org/css-flexbox/#max-main-size-property
align_self: T
This is align-self
, defaulting to align-items
if auto
depends_on_block_constraints: bool
Whether or not the size of this FlexItem
depends on its block constraints.
preferred_aspect_ratio: Option<AspectRatio>
§automatic_cross_size: Size<Au>
The automatic size in the cross axis. https://drafts.csswg.org/css-sizing-3/#automatic-size
automatic_cross_size_for_intrinsic_sizing: Size<Au>
Implementations§
Source§impl<'a> FlexItem<'a>
impl<'a> FlexItem<'a>
fn new(flex_context: &FlexContext<'_>, box_: &'a FlexItemBox) -> Self
Source§impl FlexItem<'_>
impl FlexItem<'_>
Sourcefn layout(
&self,
used_main_size: Au,
flex_context: &FlexContext<'_>,
used_cross_size_override: Option<Au>,
) -> FlexItemLayoutResult
fn layout( &self, used_main_size: Au, flex_context: &FlexContext<'_>, used_cross_size_override: Option<Au>, ) -> FlexItemLayoutResult
Return the hypothetical cross size together with laid out contents of the fragment. From https://drafts.csswg.org/css-flexbox/#algo-cross-item:
performing layout as if it were an in-flow block-level box with the used main size and the given available space, treating
auto
asfit-content
.
fn synthesized_baseline_relative_to_margin_box(&self, content_size: Au) -> Au
Sourcefn resolve_auto_margins(
&self,
flex_context: &FlexContext<'_>,
line_cross_size: Au,
item_cross_content_size: Au,
space_distributed_to_auto_main_margins: Au,
) -> FlexRelativeSides<Au>
fn resolve_auto_margins( &self, flex_context: &FlexContext<'_>, line_cross_size: Au, item_cross_content_size: Au, space_distributed_to_auto_main_margins: Au, ) -> FlexRelativeSides<Au>
Return the cross-start, cross-end, main-start, and main-end margins, with auto
values resolved.
See:
Sourcefn align_along_cross_axis(
&self,
margin: &FlexRelativeSides<Au>,
used_cross_size: &Au,
line_cross_size: Au,
propagated_baseline: Au,
max_propagated_baseline: Au,
wrap_reverse: bool,
) -> Au
fn align_along_cross_axis( &self, margin: &FlexRelativeSides<Au>, used_cross_size: &Au, line_cross_size: Au, propagated_baseline: Au, max_propagated_baseline: Au, wrap_reverse: bool, ) -> Au
Return the coordinate of the cross-start side of the content area
fn inline_content_sizes( &self, flex_context: &FlexContext<'_>, block_size: Au, ) -> ContentSizes
Auto Trait Implementations§
impl<'a> Freeze for FlexItem<'a>
impl<'a> !RefUnwindSafe for FlexItem<'a>
impl<'a> Send for FlexItem<'a>
impl<'a> Sync for FlexItem<'a>
impl<'a> Unpin for FlexItem<'a>
impl<'a> !UnwindSafe for FlexItem<'a>
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> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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