Trait kas::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§

source

fn set_dim(&mut self, cols: usize)

Set dimension: number of columns or rows

source

fn widths_and_rules(&mut self) -> (&mut [i32], &mut [SizeRules])

Access widths and rules simultaneously

Provided Methods§

source

fn rules(&mut self) -> &mut [SizeRules]

Access SizeRules for each column/row

source

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).

Object Safety§

This trait is not object safe.

Implementors§