pub struct UnifiedConstraints {Show 24 fields
pub shape_boundaries: Vec<ShapeBoundary>,
pub shape_exclusions: Vec<ShapeBoundary>,
pub available_width: AvailableSpace,
pub available_height: Option<f32>,
pub writing_mode: Option<WritingMode>,
pub direction: Option<BidiDirection>,
pub text_orientation: TextOrientation,
pub text_align: TextAlign,
pub text_justify: JustifyContent,
pub line_height: f32,
pub vertical_align: VerticalAlign,
pub overflow: OverflowBehavior,
pub segment_alignment: SegmentAlignment,
pub text_combine_upright: Option<TextCombineUpright>,
pub exclusion_margin: f32,
pub hyphenation: bool,
pub hyphenation_language: Option<Language>,
pub text_indent: f32,
pub initial_letter: Option<InitialLetter>,
pub line_clamp: Option<NonZeroUsize>,
pub text_wrap: TextWrap,
pub columns: u32,
pub column_gap: f32,
pub hanging_punctuation: bool,
}Expand description
Unified constraints combining all layout features
§CSS Inline Layout Module Level 3: Constraint Mapping
This structure maps CSS properties to layout constraints:
§\u00a7 2.1 Layout of Line Boxes
available_width: \u26a0\ufe0f CRITICAL - Should equal containing block’s inner width- Currently defaults to 0.0 which causes immediate line breaking
- Per spec: “logical width of a line box is equal to the inner logical width of its containing block”
available_height: For block-axis constraints (max-height)
§\u00a7 2.2 Layout Within Line Boxes
text_align: \u2705 Horizontal alignment (start, end, center, justify)vertical_align: \u26a0\ufe0f PARTIAL - Only baseline supported, missing:- top, bottom, middle, text-top, text-bottom
, values - sub, super positions
line_height: \u2705 Distance between baselines
§\u00a7 3 Baselines and Alignment Metrics
text_orientation: \u2705 For vertical writing (sideways, upright)writing_mode: \u2705 horizontal-tb, vertical-rl, vertical-lrdirection: \u2705 ltr, rtl for BiDi
§\u00a7 4 Baseline Alignment (vertical-align property)
\u26a0\ufe0f INCOMPLETE: Only basic baseline alignment implemented
§\u00a7 5 Line Spacing (line-height property)
line_height: \u2705 Implemented- \u274c MISSING: line-fit-edge for controlling which edges contribute to line height
§\u00a7 6 Trimming Leading (text-box-trim)
- \u274c NOT IMPLEMENTED: text-box-trim property
- \u274c NOT IMPLEMENTED: text-box-edge property
§CSS Text Module Level 3
text_indent: \u2705 First line indentationtext_justify: \u2705 Justification algorithm (auto, inter-word, inter-character)hyphenation: \u2705 Automatic hyphenationhanging_punctuation: \u2705 Hanging punctuation at line edges
§CSS Text Level 4
text_wrap: \u2705 balance, pretty, stableline_clamp: \u2705 Max number of lines
§CSS Writing Modes Level 4
text_combine_upright: \u2705 Tate-chu-yoko for vertical text
§CSS Shapes Module
shape_boundaries: \u2705 Custom line box shapesshape_exclusions: \u2705 Exclusion areas (float-like behavior)exclusion_margin: \u2705 Margin around exclusions
§Multi-column Layout
columns: \u2705 Number of columnscolumn_gap: \u2705 Gap between columns
§Known Issues:
- [ISSUE] available_width defaults to Definite(0.0) instead of containing block width
- [ISSUE] vertical_align only supports baseline
- [TODO] initial-letter (drop caps) not implemented
Fields§
§shape_boundaries: Vec<ShapeBoundary>§shape_exclusions: Vec<ShapeBoundary>§available_width: AvailableSpace§available_height: Option<f32>§writing_mode: Option<WritingMode>§direction: Option<BidiDirection>§text_orientation: TextOrientation§text_align: TextAlign§text_justify: JustifyContent§line_height: f32§vertical_align: VerticalAlign§overflow: OverflowBehavior§segment_alignment: SegmentAlignment§text_combine_upright: Option<TextCombineUpright>§exclusion_margin: f32§hyphenation: bool§hyphenation_language: Option<Language>§text_indent: f32§initial_letter: Option<InitialLetter>§line_clamp: Option<NonZeroUsize>§text_wrap: TextWrap§columns: u32§column_gap: f32§hanging_punctuation: boolTrait Implementations§
Source§impl Clone for UnifiedConstraints
impl Clone for UnifiedConstraints
Source§fn clone(&self) -> UnifiedConstraints
fn clone(&self) -> UnifiedConstraints
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnifiedConstraints
impl Debug for UnifiedConstraints
Source§impl Default for UnifiedConstraints
impl Default for UnifiedConstraints
Source§impl Hash for UnifiedConstraints
impl Hash for UnifiedConstraints
Source§impl PartialEq for UnifiedConstraints
impl PartialEq for UnifiedConstraints
impl Eq for UnifiedConstraints
Auto Trait Implementations§
impl Freeze for UnifiedConstraints
impl RefUnwindSafe for UnifiedConstraints
impl Send for UnifiedConstraints
impl Sync for UnifiedConstraints
impl Unpin for UnifiedConstraints
impl UnwindSafe for UnifiedConstraints
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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