pub struct LayoutConstraints<'a> {
pub available_size: LogicalSize,
pub writing_mode: LayoutWritingMode,
pub bfc_state: Option<&'a mut BfcState>,
pub text_align: TextAlign,
pub containing_block_size: LogicalSize,
pub available_width_type: AvailableSpace,
}Expand description
Input constraints for a layout function.
Fields§
§available_size: LogicalSizeThe available space for the content, excluding padding and borders.
writing_mode: LayoutWritingModeThe CSS writing-mode of the context.
bfc_state: Option<&'a mut BfcState>The state of the parent Block Formatting Context, if applicable. This is how state (like floats) is passed down.
text_align: TextAlign§containing_block_size: LogicalSizeThe size of the containing block (parent’s content box). This is used for resolving percentage-based sizes and as parent_size for Taffy.
available_width_type: AvailableSpaceThe semantic type of the available width constraint.
This field is crucial for correct inline layout caching:
Definite(w): Normal layout with a specific available widthMinContent: Intrinsic minimum width measurement (maximum wrapping)MaxContent: Intrinsic maximum width measurement (no wrapping)
When caching inline layouts, we must track which constraint type was used
to compute the cached result. A layout computed with MinContent (width=0)
must not be reused when the actual available width is known.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for LayoutConstraints<'a>
impl<'a> RefUnwindSafe for LayoutConstraints<'a>
impl<'a> Send for LayoutConstraints<'a>
impl<'a> Sync for LayoutConstraints<'a>
impl<'a> Unpin for LayoutConstraints<'a>
impl<'a> !UnwindSafe for LayoutConstraints<'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
Mutably borrows from an owned value. Read more
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 more