Struct layout_2013::floats::SpeculatedFloatPlacement
source · pub struct SpeculatedFloatPlacement {
pub left: Au,
pub right: Au,
}
Expand description
The speculated inline sizes of floats flowing through or around a flow (depending on whether the flow is a block formatting context). These speculations are always upper bounds; the actual inline sizes might be less. Note that this implies that a speculated value of zero is a guarantee that there will be no floats on that side.
This is used for two purposes: (a) determining whether we can lay out blocks in parallel; (b) guessing the inline-sizes of block formatting contexts in an effort to lay them out in parallel.
Fields§
§left: Au
The estimated inline size (an upper bound) of the left floats flowing through this flow.
right: Au
The estimated inline size (an upper bound) of the right floats flowing through this flow.
Implementations§
source§impl SpeculatedFloatPlacement
impl SpeculatedFloatPlacement
sourcepub fn zero() -> SpeculatedFloatPlacement
pub fn zero() -> SpeculatedFloatPlacement
Returns a SpeculatedFloatPlacement
objects with both left and right speculated inline
sizes initialized to zero.
sourcepub fn compute_floats_in(&mut self, flow: &mut dyn Flow)
pub fn compute_floats_in(&mut self, flow: &mut dyn Flow)
Given the speculated inline size of the floats out for the inorder predecessor of this flow, computes the speculated inline size of the floats flowing in.
sourcepub fn compute_floats_out(&mut self, flow: &mut dyn Flow)
pub fn compute_floats_out(&mut self, flow: &mut dyn Flow)
Given the speculated inline size of the floats out for this flow’s last child, computes the speculated inline size of the floats out for this flow.
sourcepub fn compute_floats_in_for_first_child(
parent_flow: &mut dyn Flow,
) -> SpeculatedFloatPlacement
pub fn compute_floats_in_for_first_child( parent_flow: &mut dyn Flow, ) -> SpeculatedFloatPlacement
Given a flow, computes the speculated inline size of the floats in of its first child.
Trait Implementations§
source§impl Clone for SpeculatedFloatPlacement
impl Clone for SpeculatedFloatPlacement
source§fn clone(&self) -> SpeculatedFloatPlacement
fn clone(&self) -> SpeculatedFloatPlacement
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SpeculatedFloatPlacement
impl Debug for SpeculatedFloatPlacement
impl Copy for SpeculatedFloatPlacement
Auto Trait Implementations§
impl Freeze for SpeculatedFloatPlacement
impl RefUnwindSafe for SpeculatedFloatPlacement
impl Send for SpeculatedFloatPlacement
impl Sync for SpeculatedFloatPlacement
impl Unpin for SpeculatedFloatPlacement
impl UnwindSafe for SpeculatedFloatPlacement
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> 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