pub struct HostState {Show 13 fields
pub ssh_config: SshConfigFile,
pub list: Vec<HostEntry>,
pub patterns: Vec<PatternEntry>,
pub display_list: Vec<HostListItem>,
pub render_cache: HostListRenderCache,
pub undo_stack: Vec<DeletedHost>,
pub multi_select: HashSet<usize>,
pub sort_mode: SortMode,
pub group_by: GroupBy,
pub view_mode: ViewMode,
pub group_filter: Option<String>,
pub group_tab_order: Vec<String>,
pub group_host_counts: HashMap<String, usize>,
}Expand description
Host, group, sort and view state grouped off the App god-struct. Holds
the parsed ~/.ssh/config, the resolved host + pattern entries, the
display list built from them, the render cache, the undo stack for
deletions, the multi-select set for bulk snippet runs and all sort /
group / view UI-state. Pure state container.
Fields§
§ssh_config: SshConfigFile§list: Vec<HostEntry>§patterns: Vec<PatternEntry>§display_list: Vec<HostListItem>§render_cache: HostListRenderCache§undo_stack: Vec<DeletedHost>§multi_select: HashSet<usize>Host indices selected for multi-host snippet execution (space to toggle).
sort_mode: SortMode§group_by: GroupBy§view_mode: ViewMode§group_filter: Option<String>Currently active group filter. None = show all groups.
group_tab_order: Vec<String>Ordered list of group names from the current display list.
group_host_counts: HashMap<String, usize>Host/pattern counts per group (computed before group filtering).
Implementations§
Source§impl HostState
impl HostState
Sourcepub fn from_config(
ssh_config: SshConfigFile,
hosts: Vec<HostEntry>,
patterns: Vec<PatternEntry>,
display_list: Vec<HostListItem>,
) -> Self
pub fn from_config( ssh_config: SshConfigFile, hosts: Vec<HostEntry>, patterns: Vec<PatternEntry>, display_list: Vec<HostListItem>, ) -> Self
Construct from a loaded config and pre-resolved host/pattern lists.
Sourcepub fn set_group_by(&mut self, by: GroupBy)
pub fn set_group_by(&mut self, by: GroupBy)
Change the group-by mode and reset any active group filter in
lockstep. Callers that change group_by directly would leave a
stale group_filter referring to a group that no longer exists.
Sourcepub fn toggle_view_mode(&mut self)
pub fn toggle_view_mode(&mut self)
Flip the host list between Compact and Detailed view.
Sourcepub fn toggle_multi_select(&mut self, idx: usize) -> bool
pub fn toggle_multi_select(&mut self, idx: usize) -> bool
Toggle multi-select membership for the host at idx. Returns
true when idx is now selected (was inserted) and false when
it is now unselected (was removed) so the caller can react
without re-reading the set.
Auto Trait Implementations§
impl Freeze for HostState
impl RefUnwindSafe for HostState
impl Send for HostState
impl Sync for HostState
impl Unpin for HostState
impl UnsafeUnpin for HostState
impl UnwindSafe for HostState
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> 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