pub struct SnippetsView {
pub selected: usize,
pub search_mode: bool,
pub search_query: String,
pub filtered_indices: Vec<usize>,
pub popup: Option<SnippetPopup>,
}Expand description
UI state specific to the Snippets screen.
Fields§
§selected: usizeSelected row index within filtered_indices.
search_mode: boolTrue when the user is actively typing a search query.
search_query: StringCurrent search query.
filtered_indices: Vec<usize>Indices into AppState.snippets matching the current query.
popup: Option<SnippetPopup>Currently visible popup (if any).
Implementations§
Source§impl SnippetsView
impl SnippetsView
Sourcepub fn selected_snippet_idx(&self) -> Option<usize>
pub fn selected_snippet_idx(&self) -> Option<usize>
Returns the index into AppState.snippets for the selected row.
Sourcepub fn rebuild_filter(&mut self, snippets: &[Snippet], query: &str)
pub fn rebuild_filter(&mut self, snippets: &[Snippet], query: &str)
Rebuilds filtered_indices with case-insensitive substring matching.
pub fn select_next(&mut self)
pub fn select_prev(&mut self)
Trait Implementations§
Source§impl Debug for SnippetsView
impl Debug for SnippetsView
Auto Trait Implementations§
impl Freeze for SnippetsView
impl RefUnwindSafe for SnippetsView
impl Send for SnippetsView
impl Sync for SnippetsView
impl Unpin for SnippetsView
impl UnsafeUnpin for SnippetsView
impl UnwindSafe for SnippetsView
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