pub struct ConfigEditorState {Show 20 fields
pub selected_file: ConfigFile,
pub view: ConfigEditorView,
pub focus: ConfigEditorFocus,
pub file_cursor: usize,
pub key_cursor: usize,
pub query: String,
pub query_caret: usize,
pub search_focus: ConfigEditorSearchFocus,
pub recent_queries: Vec<String>,
pub recent_queries_path: PathBuf,
pub recent_queries_dirty: bool,
pub query_last_input_change: Instant,
pub last_saved_query_value: Option<String>,
pub recent_cursor: usize,
pub bookmarked_keys: Vec<String>,
pub bookmarked_keys_path: PathBuf,
pub bookmarked_keys_dirty: bool,
pub bookmark_cursor: usize,
pub popup: Option<EditPopupState>,
pub status: Option<String>,
}Expand description
Top-level editor state held by crate::state::AppState::config_editor_state.
Fields§
§selected_file: ConfigFileCurrently selected config file (Phase 1: only Settings is functional).
view: ConfigEditorViewActive top-pane view.
focus: ConfigEditorFocusWhere typed characters land.
file_cursor: usizeCursor in the file-list view (0..=3).
key_cursor: usizeCursor in the key-list view, indexing into the filtered list.
query: StringSearch query text (substring/fuzzy filter applied to keys).
query_caret: usizeCaret position inside query.
search_focus: ConfigEditorSearchFocusWhich sub-panel in the search pane currently has focus.
recent_queries: Vec<String>Most-recent-first search history for the config editor.
recent_queries_path: PathBufPath where config-editor recent searches are persisted.
recent_queries_dirty: boolDirty flag indicating recent queries should be flushed to disk.
query_last_input_change: InstantLast time the query text changed from user input.
last_saved_query_value: Option<String>Last query value saved by debounce logic to avoid duplicate writes.
recent_cursor: usizeCursor in recent_queries.
bookmarked_keys: Vec<String>Bookmarked setting keys (canonical EditableSetting::key).
bookmarked_keys_path: PathBufPath where config-editor bookmarks are persisted.
bookmarked_keys_dirty: boolDirty flag indicating bookmarks should be flushed to disk.
bookmark_cursor: usizeCursor in bookmarked_keys.
popup: Option<EditPopupState>Active edit popup, if any.
status: Option<String>Last save outcome / hint, shown in the footer.
Implementations§
Source§impl ConfigEditorState
impl ConfigEditorState
Sourcepub fn filtered_keys(&self) -> Vec<&'static EditableSetting>
pub fn filtered_keys(&self) -> Vec<&'static EditableSetting>
What: Build the filtered key list for the currently selected file and active query.
Inputs: None (uses self.selected_file and self.query).
Output:
- Vector of schema entries that match the query (or all entries if
queryis empty), in declaration order.
Details:
- Phase 1 uses a case-insensitive substring match against the
canonical key and aliases via
EditableSetting::matches.
Sourcepub fn selected_key(&self) -> Option<&'static EditableSetting>
pub fn selected_key(&self) -> Option<&'static EditableSetting>
What: Look up the schema entry currently highlighted in the key list.
Inputs: None.
Output:
Some(&EditableSetting)when the cursor lands on a row,Nonewhen the filter is empty (no matches).
Sourcepub fn clamp_key_cursor(&mut self)
pub fn clamp_key_cursor(&mut self)
What: Clamp key_cursor to the current filtered list length.
Inputs: None.
Output: Mutates self.key_cursor.
Details: Called after query edits or after rebuilding the key list.
Sourcepub fn push_recent_query(&mut self, query: &str)
pub fn push_recent_query(&mut self, query: &str)
What: Push a query into most-recent-first history with de-duplication.
Inputs:
query: Raw search query.
Output:
- Mutates
recent_queriesandrecent_cursor.
Sourcepub fn toggle_bookmark_key(&mut self, key: &str) -> bool
pub fn toggle_bookmark_key(&mut self, key: &str) -> bool
Toggle bookmark for a setting key.
Sourcepub fn clamp_recent_cursor(&mut self)
pub fn clamp_recent_cursor(&mut self)
Clamp recent cursor to bounds.
Sourcepub fn clamp_bookmark_cursor(&mut self)
pub fn clamp_bookmark_cursor(&mut self)
Clamp bookmark cursor to bounds.
Sourcepub fn selected_recent_query(&self) -> Option<&str>
pub fn selected_recent_query(&self) -> Option<&str>
Resolve the currently selected recent query.
Sourcepub fn selected_bookmarked_key(&self) -> Option<&str>
pub fn selected_bookmarked_key(&self) -> Option<&str>
Resolve the currently selected bookmarked setting key.
Trait Implementations§
Source§impl Clone for ConfigEditorState
impl Clone for ConfigEditorState
Source§fn clone(&self) -> ConfigEditorState
fn clone(&self) -> ConfigEditorState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfigEditorState
impl Debug for ConfigEditorState
Auto Trait Implementations§
impl Freeze for ConfigEditorState
impl RefUnwindSafe for ConfigEditorState
impl Send for ConfigEditorState
impl Sync for ConfigEditorState
impl Unpin for ConfigEditorState
impl UnsafeUnpin for ConfigEditorState
impl UnwindSafe for ConfigEditorState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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