pub struct SortState {
pub column: Option<usize>,
pub column_name: Option<String>,
pub order: SortOrder,
pub history: VecDeque<SortHistoryEntry>,
pub max_history: usize,
pub total_sorts: usize,
pub last_sort_time: Option<Instant>,
}
Expand description
State for column sorting
Fields§
§column: Option<usize>
Currently sorted column index
column_name: Option<String>
Column name (for display)
order: SortOrder
Sort order (Ascending, Descending, None)
history: VecDeque<SortHistoryEntry>
History of sort operations
max_history: usize
Maximum history size
total_sorts: usize
Total sorts performed
last_sort_time: Option<Instant>
Last sort time
Implementations§
Source§impl SortState
impl SortState
pub fn new() -> Self
Sourcepub fn set_sort(
&mut self,
column_index: usize,
column_name: String,
order: SortOrder,
row_count: usize,
)
pub fn set_sort( &mut self, column_index: usize, column_name: String, order: SortOrder, row_count: usize, )
Set sort column and order
Sourcepub fn clear_sort(&mut self)
pub fn clear_sort(&mut self)
Clear sort (return to original order)
Sourcepub fn get_next_order(&self, column_index: usize) -> SortOrder
pub fn get_next_order(&self, column_index: usize) -> SortOrder
Get the next sort order for a column
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SortState
impl RefUnwindSafe for SortState
impl Send for SortState
impl Sync for SortState
impl Unpin for SortState
impl UnwindSafe for SortState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more