Trait kas_core::layout::RowStorage
source · pub trait RowStorage: Clone + Debug + Sealed {
// Required methods
fn set_dim(&mut self, cols: usize);
fn widths_and_rules(&mut self) -> (&mut [i32], &mut [SizeRules]);
// Provided methods
fn rules(&mut self) -> &mut [SizeRules] { ... }
fn widths(&mut self) -> &mut [i32] { ... }
}Expand description
Requirements of row solver storage type
Usually this is set by a crate::layout::RowSolver from
crate::Layout::size_rules, then used by crate::Layout::set_rect to
divide the assigned rect between children.
It may be useful to access this directly if not solving size rules normally;
specifically this allows a different size solver to replace size_rules and
influence set_rect.
Note: some implementations allocate when Self::set_dim is first called.
It is expected that this method is called before other methods.
Required Methods§
sourcefn widths_and_rules(&mut self) -> (&mut [i32], &mut [SizeRules])
fn widths_and_rules(&mut self) -> (&mut [i32], &mut [SizeRules])
Access widths and rules simultaneously
Provided Methods§
sourcefn widths(&mut self) -> &mut [i32]
fn widths(&mut self) -> &mut [i32]
Access widths for each column/row
Widths are calculated from rules when set_rect is called. Assigning
to widths before set_rect is called only has any effect when the available
size exceeds the minimum required (see SizeRules::solve_seq).