Struct layout_2020::flow::PlacementState
source · struct PlacementState<'container> {
next_in_flow_margin_collapses_with_parent_start_margin: bool,
last_in_flow_margin_collapses_with_parent_end_margin: bool,
start_margin: CollapsedMargin,
current_margin: CollapsedMargin,
current_block_direction_position: Au,
inflow_baselines: Baselines,
is_inline_block_context: bool,
marker_block_size: Option<Au>,
containing_block: &'container ContainingBlock<'container>,
}
Expand description
State that we maintain when placing blocks.
In parallel mode, this placement is done after all child blocks are laid out. In sequential mode, this is done right after each block is laid out.
Fields§
§next_in_flow_margin_collapses_with_parent_start_margin: bool
§last_in_flow_margin_collapses_with_parent_end_margin: bool
§start_margin: CollapsedMargin
§current_margin: CollapsedMargin
§current_block_direction_position: Au
§inflow_baselines: Baselines
§is_inline_block_context: bool
§marker_block_size: Option<Au>
If this PlacementState
is laying out a list item with an outside marker. Record the
block size of that marker, because the content block size of the list item needs to be at
least as tall as the marker size – even though the marker doesn’t advance the block
position of the placement.
containing_block: &'container ContainingBlock<'container>
The ContainingBlock
of the container into which this PlacementState
is laying out
fragments. This is used to convert between physical and logical geometry.
Implementations§
source§impl<'container> PlacementState<'container>
impl<'container> PlacementState<'container>
fn new( collapsible_with_parent_start_margin: CollapsibleWithParentStartMargin, containing_block: &'container ContainingBlock<'container>, ) -> PlacementState<'_>
fn place_fragment_and_update_baseline( &mut self, fragment: &mut Fragment, sequential_layout_state: Option<&mut SequentialLayoutState>, )
sourcefn place_fragment(
&mut self,
fragment: &mut Fragment,
sequential_layout_state: Option<&mut SequentialLayoutState>,
)
fn place_fragment( &mut self, fragment: &mut Fragment, sequential_layout_state: Option<&mut SequentialLayoutState>, )
fn finish(self) -> (Au, CollapsedBlockMargins, Baselines)
Auto Trait Implementations§
impl<'container> Freeze for PlacementState<'container>
impl<'container> !RefUnwindSafe for PlacementState<'container>
impl<'container> Send for PlacementState<'container>
impl<'container> Sync for PlacementState<'container>
impl<'container> Unpin for PlacementState<'container>
impl<'container> !UnwindSafe for PlacementState<'container>
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> 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>
Converts
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>
Converts
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert