pub trait SortedSearch: ListViewer {
// Required methods
fn search_pos(&self) -> i32;
fn set_search_pos(&mut self, pos: i32);
fn shift_state(&self) -> u8;
fn set_shift_state(&mut self, s: u8);
fn search(&self, cur: &[char]) -> i32;
}Expand description
The type-to-search hooks — the polymorphic parts of the incremental-search
state machine. The shared machine is sorted_handle_event +
sorted_cursor; concrete widgets (a sorted list box, a file list)
implement these.
Required Methods§
Sourcefn search_pos(&self) -> i32
fn search_pos(&self) -> i32
The index of the last matched char in the focused item’s text; -1 = no active search.
fn set_search_pos(&mut self, pos: i32)
Sourcefn shift_state(&self) -> u8
fn shift_state(&self) -> u8
The shift bits captured at the search_pos -1↔0 transition. A plain
sorted list box never reads it; file/dir subclasses’ search does.
fn set_shift_state(&mut self, s: u8)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".