Skip to main content

ContainersOverviewState

Struct ContainersOverviewState 

Source
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: ViewMode

Toggle 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

Source

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.

Source

pub fn clear_refresh(&mut self)

Drop the active refresh batch. Called when the queue drains and in-flight count returns to zero.

Source

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).

Source

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.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ContainersOverviewState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V