Struct StatRowsLayout

Source
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>

Source

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.

Source

pub fn report(&self) -> StatRowsReport

Full and visible-prefix measurements; no geometry is changed by reading.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<'a> Debug for StatRowsLayout<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for StatRowsLayout<'a>

§

impl<'a> RefUnwindSafe for StatRowsLayout<'a>

§

impl<'a> Send for StatRowsLayout<'a>

§

impl<'a> Sync for StatRowsLayout<'a>

§

impl<'a> Unpin for StatRowsLayout<'a>

§

impl<'a> UnwindSafe for StatRowsLayout<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.