pub struct StatRowsLayout<'a> { /* private fields */ }Expand description
Immutable borrowed layout with fixed stack storage for at most 64 row geometries, no heap allocation or retained cache. Rebuild for changed copy, styles or bounds; construction scans all supplied text, including hidden rows. Source lengths and scanning work are caller-owned, not capped here. Submission copies visible source into the existing bounded UI arena.
Implementations§
Source§impl<'a> StatRowsLayout<'a>
impl<'a> StatRowsLayout<'a>
Sourcepub fn new(
bounds: Rect,
rows: &'a [StatRow<'a>],
style: StatRowsStyle,
) -> Result<StatRowsLayout<'a>, UiError>
pub fn new( bounds: Rect, rows: &'a [StatRow<'a>], style: StatRowsStyle, ) -> Result<StatRowsLayout<'a>, UiError>
Measure with the shared wrapper, keeping every block at its supplied size. Columns require the widest natural label and value plus the gap to fit. Otherwise each label is above its value at full available width; descriptions always follow the pair at full width. Empty blocks reserve one line slot. Zero/tiny valid bounds return hidden rows, not cropped text.
Invalid/nonfinite bounds, sizes, colors or gaps return InvalidLayout;
so does unrepresentable geometry/height. Sizes use the existing UI range
1..=256. More than MAX_STAT_ROWS returns Capacity.
Sourcepub fn report(&self) -> StatRowsReport
pub fn report(&self) -> StatRowsReport
Full and visible-prefix measurements; no geometry is changed by reading.
Sourcepub fn rows(&self) -> &[StatRowGeometry]
pub fn rows(&self) -> &[StatRowGeometry]
Visible geometry in source order, paired with the same source prefix. These rectangles are also the actual retained inspection/paint bounds.
Sourcepub fn submit(
&self,
group: &mut UiComposition<'_>,
) -> Result<StatRowsReport, UiError>
pub fn submit( &self, group: &mut UiComposition<'_>, ) -> Result<StatRowsReport, UiError>
Submit the measured prefix as a nested atomic group. Capacity/validation
rejection leaves no list paint or inspection commands. Existing clips
still apply; a caller must choose bounds inside its visible safe region.
Handle a rejected optional group locally or propagate ? to reject its
enclosing card. Hidden rows are reported on success, never auto-painted.