pub struct InlineItemMetrics {
pub source_node_id: Option<NodeId>,
pub advance_width: f32,
pub line_height_contribution: f32,
pub can_break: bool,
pub line_index: u32,
pub x_offset: f32,
}Expand description
Per-item metrics cached from the last IFC layout.
These metrics enable incremental IFC relayout (Phase 2 optimization): when a single inline item changes, we can check whether its advance width changed and potentially skip full line-breaking for unaffected lines.
Index in CachedInlineLayout::item_metrics matches the item order in
UnifiedLayout::items.
Fields§
§source_node_id: Option<NodeId>The DOM NodeId of the source node for this item (for dirty checking).
None for generated content (list markers, hyphens, etc.)
advance_width: f32Advance width of this item (glyph run width, inline-block width, etc.)
line_height_contribution: f32Advance height contribution from this item to its line box.
can_break: boolWhether this item can participate in line breaking.
false for items inside white-space: nowrap or white-space: pre.
line_index: u32Which line this item was placed on (0-indexed).
x_offset: f32X offset within its line.
Trait Implementations§
Source§impl Clone for InlineItemMetrics
impl Clone for InlineItemMetrics
Source§fn clone(&self) -> InlineItemMetrics
fn clone(&self) -> InlineItemMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for InlineItemMetrics
impl RefUnwindSafe for InlineItemMetrics
impl Send for InlineItemMetrics
impl Sync for InlineItemMetrics
impl Unpin for InlineItemMetrics
impl UnsafeUnpin for InlineItemMetrics
impl UnwindSafe for InlineItemMetrics
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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