pub struct HistoryManager {
pub search_query: String,
pub matches: Vec<HistoryMatch>,
pub selected_index: usize,
}
Expand description
Manages history search and navigation
Fields§
§search_query: String
§matches: Vec<HistoryMatch>
§selected_index: usize
Implementations§
Source§impl HistoryManager
impl HistoryManager
pub fn new() -> Self
Sourcepub fn update_matches(&mut self, history: &CommandHistory)
pub fn update_matches(&mut self, history: &CommandHistory)
Update matches based on current search query
Sourcepub fn next_match(&mut self)
pub fn next_match(&mut self)
Navigate to next match
Sourcepub fn previous_match(&mut self)
pub fn previous_match(&mut self)
Navigate to previous match
Sourcepub fn get_selected(&self) -> Option<&HistoryMatch>
pub fn get_selected(&self) -> Option<&HistoryMatch>
Get currently selected match
Sourcepub fn set_search(&mut self, query: String, history: &CommandHistory)
pub fn set_search(&mut self, query: String, history: &CommandHistory)
Set search query and update matches
Sourcepub fn get_visible_range(&self, height: usize) -> (usize, usize)
pub fn get_visible_range(&self, height: usize) -> (usize, usize)
Get visible range of matches for rendering
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HistoryManager
impl RefUnwindSafe for HistoryManager
impl Send for HistoryManager
impl Sync for HistoryManager
impl Unpin for HistoryManager
impl UnwindSafe for HistoryManager
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