Skip to main content

SortableList

Trait SortableList 

Source
pub trait SortableList {
    // Required methods
    fn sort_state(&self) -> SortState;
    fn apply_sort(&mut self, state: &SortState, tx: &AppTx);
    fn allows_property(&self) -> bool;

    // Provided method
    fn is_unsorted(&self) -> bool { ... }
}
Expand description

A list the sort dialog can sort.

Required Methods§

Source

fn sort_state(&self) -> SortState

Source

fn apply_sort(&mut self, state: &SortState, tx: &AppTx)

Apply a selection from the sort dialog. Property sorts are only offered where Self::allows_property says so.

Source

fn allows_property(&self) -> bool

Whether the dialog offers Property. Query-backed lists put the key in the query; listings fetch values with PropertySort.

Provided Methods§

Source

fn is_unsorted(&self) -> bool

The rows are in the list’s natural order (recency, match rank), not any sort the dialog offers — it then shows “Unsorted” until a pick. Self::sort_state still names the field / order the first toggle starts from. Only the file finder and the Ctrl+K recents say so.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§