Struct CardLayout

Source
pub struct CardLayout<'a> { /* private fields */ }
Expand description

Immutable fixed-storage measured card. Rebuild on copy/bounds changes; no cache, allocation, input consumption or external mutation occurs in layout.

Implementations§

Source§

impl<'a> CardLayout<'a>

Source

pub fn new( bounds: Rect, source: CardContent<'a>, ) -> Result<CardLayout<'a>, UiError>

Validate/measure before insertion. Capacity means a section/action/byte/ total-stat-row bound was exceeded. DuplicateId means colliding IDs. InvalidLayout includes a missing primary, blank title/action, multiline action, impossible bounds or unrepresentable geometry. All actions and the full title must fit at fixed sizes; insufficient space never inserts a partial card. Unknown action queries return None. Existing UI budgets are checked atomically by submission, not reserved by this pure layout.

Source

pub fn bounds(&self) -> Rect

Card panel in caller logical coordinates.

Source

pub fn title_rect(&self) -> Rect

Full fixed-size title rectangle.

Source

pub fn content_bounds(&self) -> Rect

Viewport for sections; feed its height to task274 ScrollState.

Source

pub fn content_extent(&self) -> f32

Full content-space height; feed to ScrollState::set_extents on reflow.

Source

pub fn section_rect(&self, index: usize) -> Option<Rect>

Unscrolled section rectangle, relative to the content origin.

Source

pub fn action_rect(&self, id: u64) -> Option<Rect>

Exactly the rectangle passed to the painted button and its hit registry.

Source

pub fn submit( &self, group: &mut UiComposition<'_>, scroll: Option<&ScrollState>, ) -> Result<CardReport, UiError>

Atomically submit modal, panel, full title, content/notice and every action. All interaction, clip and inspection changes roll back through task281. Scroll must match both extents exactly and have positive viewport height; mismatch fails before insertion. Scroll is borrowed immutably: updating/ resetting it is caller-owned and lies outside the composition transaction. Existing ancestor clips apply unchanged, including to action hits; callers must keep the action area inside their visible safe region.

Trait Implementations§

Source§

impl<'a> Debug for CardLayout<'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 CardLayout<'a>

§

impl<'a> RefUnwindSafe for CardLayout<'a>

§

impl<'a> Send for CardLayout<'a>

§

impl<'a> Sync for CardLayout<'a>

§

impl<'a> Unpin for CardLayout<'a>

§

impl<'a> UnwindSafe for CardLayout<'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.