pub struct SearchManager { /* private fields */ }
Expand description
Manages search state and provides iteration through matches
Implementations§
Source§impl SearchManager
impl SearchManager
Sourcepub fn with_config(config: SearchConfig) -> Self
pub fn with_config(config: SearchConfig) -> Self
Create with custom configuration
Sourcepub fn set_config(&mut self, config: SearchConfig)
pub fn set_config(&mut self, config: SearchConfig)
Update search configuration
Sourcepub fn set_case_sensitive(&mut self, case_sensitive: bool)
pub fn set_case_sensitive(&mut self, case_sensitive: bool)
Set case sensitivity
Sourcepub fn search(
&mut self,
pattern: &str,
data: &[Vec<String>],
visible_columns: Option<&[usize]>,
) -> usize
pub fn search( &mut self, pattern: &str, data: &[Vec<String>], visible_columns: Option<&[usize]>, ) -> usize
Perform a search on the given data Returns the number of matches found
Sourcepub fn current_match(&self) -> Option<&SearchMatch>
pub fn current_match(&self) -> Option<&SearchMatch>
Get the current match (if any)
Sourcepub fn next_match(&mut self) -> Option<&SearchMatch>
pub fn next_match(&mut self) -> Option<&SearchMatch>
Move to the next match
Sourcepub fn previous_match(&mut self) -> Option<&SearchMatch>
pub fn previous_match(&mut self) -> Option<&SearchMatch>
Move to the previous match
Sourcepub fn jump_to_match(&mut self, index: usize) -> Option<&SearchMatch>
pub fn jump_to_match(&mut self, index: usize) -> Option<&SearchMatch>
Jump to a specific match index
Sourcepub fn first_match(&self) -> Option<&SearchMatch>
pub fn first_match(&self) -> Option<&SearchMatch>
Get the first match (useful for initial navigation)
Sourcepub fn all_matches(&self) -> &[SearchMatch]
pub fn all_matches(&self) -> &[SearchMatch]
Get all matches
Sourcepub fn match_count(&self) -> usize
pub fn match_count(&self) -> usize
Get the total number of matches
Sourcepub fn current_match_number(&self) -> usize
pub fn current_match_number(&self) -> usize
Get current match index (1-based for display)
Sourcepub fn has_active_search(&self) -> bool
pub fn has_active_search(&self) -> bool
Check if there’s an active search
Sourcepub fn calculate_scroll_offset(
&self,
match_pos: &SearchMatch,
viewport_height: usize,
current_offset: usize,
) -> usize
pub fn calculate_scroll_offset( &self, match_pos: &SearchMatch, viewport_height: usize, current_offset: usize, ) -> usize
Calculate scroll offset needed to show a match in viewport
Sourcepub fn find_next_from(
&self,
current_row: usize,
current_col: usize,
) -> Option<&SearchMatch>
pub fn find_next_from( &self, current_row: usize, current_col: usize, ) -> Option<&SearchMatch>
Find the next match from a given position
Sourcepub fn find_previous_from(
&self,
current_row: usize,
current_col: usize,
) -> Option<&SearchMatch>
pub fn find_previous_from( &self, current_row: usize, current_col: usize, ) -> Option<&SearchMatch>
Find the previous match from a given position
Source§impl SearchManager
impl SearchManager
Sourcepub fn iter(&self) -> SearchIterator<'_> ⓘ
pub fn iter(&self) -> SearchIterator<'_> ⓘ
Get an iterator over all matches
Auto Trait Implementations§
impl Freeze for SearchManager
impl RefUnwindSafe for SearchManager
impl Send for SearchManager
impl Sync for SearchManager
impl Unpin for SearchManager
impl UnwindSafe for SearchManager
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> 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