pub struct ContainersOverviewState {
pub sort_mode: ContainersSortMode,
pub inspect_cache: InspectCache,
pub logs_cache: LogsCache,
pub refresh_batch: Option<RefreshBatch>,
pub auto_list_in_flight: HashSet<String>,
pub view_mode: ViewMode,
pub collapsed_hosts: HashSet<String>,
pub view_cache: RefCell<Option<(u64, Vec<ContainerListItem>)>>,
}Fields§
§sort_mode: ContainersSortMode§inspect_cache: InspectCache§logs_cache: LogsCache§refresh_batch: Option<RefreshBatch>Currently-running R batch, if any. None when idle.
auto_list_in_flight: HashSet<String>Aliases whose docker ps listing was kicked off by the
scroll-driven auto-refresh helper and has not yet returned.
Lets the helper skip a re-spawn while one is already pending.
Cleared by handle_container_listing on arrival.
view_mode: ViewModeToggle for the per-row detail panel on the right. Mirrors the
host-list v toggle. Default Detailed so the panel is visible
whenever the terminal is wide enough.
collapsed_hosts: HashSet<String>Aliases whose container group is currently collapsed in the AlphaHost rendering. Persisted across sessions via preferences so a folded group stays folded after restart.
view_cache: RefCell<Option<(u64, Vec<ContainerListItem>)>>Memoized render list. The render and handler paths call
visible_items repeatedly (24 call sites, several per key
event) and each call cloned 6 String fields per container. The
cache stores the built Vec<ContainerListItem> keyed on a
content fingerprint over the inputs (sort_mode, search query,
collapsed_hosts, per-host (timestamp, container_count)). On a
hit we skip the collect/sort/intersperse step entirely and
return a clone of the cached vec. The fingerprint walks all
hosts but only reads a few fields each, so it is dramatically
cheaper than rebuilding the row set.
Implementations§
Source§impl ContainersOverviewState
impl ContainersOverviewState
Sourcepub fn start_refresh(&mut self, batch: RefreshBatch)
pub fn start_refresh(&mut self, batch: RefreshBatch)
Install a fresh refresh batch. Caller is responsible for spawning the initial parallel listings after this call; this method only owns the state slot.
Sourcepub fn clear_refresh(&mut self)
pub fn clear_refresh(&mut self)
Drop the active refresh batch. Called when the queue drains and in-flight count returns to zero.
Sourcepub fn set_view_mode(&mut self, mode: ViewMode) -> Result<()>
pub fn set_view_mode(&mut self, mode: ViewMode) -> Result<()>
Update view_mode and persist. Returns the persist error so the
caller can surface it (current call site discards it intentionally
to match the pre-encapsulation behavior where view-mode persist
failures only logged).
Sourcepub fn set_sort_mode(&mut self, mode: ContainersSortMode) -> Result<()>
pub fn set_sort_mode(&mut self, mode: ContainersSortMode) -> Result<()>
Update sort_mode and persist. Same contract as set_view_mode;
the call site does surface the error via a toast.
Sourcepub fn migrate_alias(&mut self, old: &str, new: &str) -> bool
pub fn migrate_alias(&mut self, old: &str, new: &str) -> bool
Rename an alias across every alias-keyed set in this state.
Returns true when collapsed_hosts changed so the caller can
persist; auto_list_in_flight and refresh_batch.in_flight_aliases
are also migrated but are not persistent so they do not affect
the return value. No-op (returns false) when old == new.
Trait Implementations§
Source§impl Debug for ContainersOverviewState
impl Debug for ContainersOverviewState
Auto Trait Implementations§
impl !Freeze for ContainersOverviewState
impl !RefUnwindSafe for ContainersOverviewState
impl Send for ContainersOverviewState
impl !Sync for ContainersOverviewState
impl Unpin for ContainersOverviewState
impl UnsafeUnpin for ContainersOverviewState
impl UnwindSafe for ContainersOverviewState
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