pub struct LayoutRecord {
pub name: String,
pub constraints: Vec<Constraint>,
pub available_size: u16,
pub computed_sizes: Vec<u16>,
pub direction: Direction,
pub alignment: Alignment,
pub margin: Sides,
pub gap: u16,
pub input_area: Rect,
pub result_rects: Vec<Rect>,
pub solve_time: Option<Duration>,
pub parent_index: Option<usize>,
}Expand description
A record of a single layout solve operation.
Fields§
§name: StringUser-provided name for identification.
constraints: Vec<Constraint>The constraints that were solved.
available_size: u16Total available size before solving.
computed_sizes: Vec<u16>Computed sizes for each constraint.
direction: DirectionLayout direction.
alignment: AlignmentAlignment mode.
margin: SidesMargin applied before solving.
gap: u16Gap between items.
input_area: RectThe input area.
result_rects: Vec<Rect>The resulting rectangles.
solve_time: Option<Duration>Time taken to solve (if measured).
parent_index: Option<usize>Parent record index (for nested layouts).
Implementations§
Source§impl LayoutRecord
impl LayoutRecord
Sourcepub fn has_overflow(&self) -> bool
pub fn has_overflow(&self) -> bool
Check if the total computed size exceeds available space (overflow).
Sourcepub fn has_underflow(&self) -> bool
pub fn has_underflow(&self) -> bool
Check if significant space remains unused (underflow).
Returns true if more than 20% of available space is unused.
Sourcepub fn utilization(&self) -> f32
pub fn utilization(&self) -> f32
Percentage of available space used.
Trait Implementations§
Source§impl Clone for LayoutRecord
impl Clone for LayoutRecord
Source§fn clone(&self) -> LayoutRecord
fn clone(&self) -> LayoutRecord
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 moreAuto Trait Implementations§
impl Freeze for LayoutRecord
impl RefUnwindSafe for LayoutRecord
impl Send for LayoutRecord
impl Sync for LayoutRecord
impl Unpin for LayoutRecord
impl UnsafeUnpin for LayoutRecord
impl UnwindSafe for LayoutRecord
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