pub struct ColumnOrder { /* private fields */ }Expand description
Manages the order and visibility of columns in a table.
Implementations§
Source§impl ColumnOrder
impl ColumnOrder
Sourcepub fn new(total_columns: usize) -> Self
pub fn new(total_columns: usize) -> Self
Creates a new ColumnOrder with default ordering (all columns visible in natural order)
Sourcepub fn total_columns(&self) -> usize
pub fn total_columns(&self) -> usize
Returns the total number of columns
Sourcepub fn swap(&mut self, col_a: usize, col_b: usize)
pub fn swap(&mut self, col_a: usize, col_b: usize)
Swaps two columns in the display order. If either column is hidden or out of bounds, this is a no-op (saturating behavior).
Sourcepub fn hide_column(&mut self, col: usize)
pub fn hide_column(&mut self, col: usize)
Hides a column by removing it from the display order. If the column is already hidden or out of bounds, this is a no-op.
Sourcepub fn show_column(&mut self, col: usize, at_index: Option<usize>)
pub fn show_column(&mut self, col: usize, at_index: Option<usize>)
Shows a column by inserting it into the display order. If at_index is None, appends to the end. If at_index is Some(idx), inserts at that position (saturated to valid range). If the column is already visible or out of bounds, this is a no-op.
Sourcepub fn move_to(&mut self, col: usize, new_index: usize)
pub fn move_to(&mut self, col: usize, new_index: usize)
Moves a column to a specific position in the display order (0-indexed). The position is saturated to the valid range. If the column is hidden or out of bounds, this is a no-op.
Sourcepub fn move_forward(&mut self, col: usize)
pub fn move_forward(&mut self, col: usize)
Moves a column one position forward (towards index 0) in the display order. If the column is already first or hidden, this is a no-op.
Sourcepub fn move_backward(&mut self, col: usize)
pub fn move_backward(&mut self, col: usize)
Moves a column one position backward (towards the end) in the display order. If the column is already last or hidden, this is a no-op.
Sourcepub fn is_visible(&self, col: usize) -> bool
pub fn is_visible(&self, col: usize) -> bool
Checks if a column is currently visible
Trait Implementations§
Source§impl Clone for ColumnOrder
impl Clone for ColumnOrder
Source§fn clone(&self) -> ColumnOrder
fn clone(&self) -> ColumnOrder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more