pub struct ContainerState {
pub pending_exec: Option<ContainerExecRequest>,
pub pending_logs: Option<ContainerLogsRequest>,
pub pending_actions: VecDeque<ContainerActionRequest>,
pub pending_fetch_aliases: Vec<String>,
pub cache: HashMap<String, ContainerCacheEntry>,
}Expand description
Always-present container-domain state: cache and cross-host pending operations.
Separate from ContainerSession, which is the per-host overlay session state.
Fields§
§pending_exec: Option<ContainerExecRequest>§pending_logs: Option<ContainerLogsRequest>§pending_actions: VecDeque<ContainerActionRequest>§pending_fetch_aliases: Vec<String>§cache: HashMap<String, ContainerCacheEntry>Implementations§
Source§impl ContainerState
impl ContainerState
Sourcepub fn queue_logs(&mut self, req: ContainerLogsRequest)
pub fn queue_logs(&mut self, req: ContainerLogsRequest)
Queue a logs request for the main loop to drain. Replaces any previous pending logs request and logs the displaced alias so a dropped request is traceable.
Sourcepub fn queue_exec(&mut self, req: ContainerExecRequest)
pub fn queue_exec(&mut self, req: ContainerExecRequest)
Queue an exec request for the main loop to drain. Same replace
and log semantics as queue_logs.
Sourcepub fn queue_action(&mut self, req: ContainerActionRequest)
pub fn queue_action(&mut self, req: ContainerActionRequest)
Queue a non-interactive container action for the worker thread.
Actions are FIFO via VecDeque::push_back; multiple actions
against the same alias process in order.
Sourcepub fn queue_fetch(&mut self, alias: String)
pub fn queue_fetch(&mut self, alias: String)
Enqueue an alias for the initial container-cache fetch. Drained by
the main loop on the next tick via drain_pending_fetches.
Sourcepub fn drain_pending_fetches(&mut self) -> Vec<String>
pub fn drain_pending_fetches(&mut self) -> Vec<String>
Take the full fetch queue, leaving it empty.
Sourcepub fn migrate_alias(&mut self, old: &str, new: &str) -> bool
pub fn migrate_alias(&mut self, old: &str, new: &str) -> bool
Move a cache entry from old to new on host rename. Returns
true when the cache changed so the caller can persist. No-op
(returns false) when old == new or no entry exists under old.
Trait Implementations§
Source§impl Debug for ContainerState
impl Debug for ContainerState
Source§impl Default for ContainerState
impl Default for ContainerState
Source§fn default() -> ContainerState
fn default() -> ContainerState
Auto Trait Implementations§
impl Freeze for ContainerState
impl RefUnwindSafe for ContainerState
impl Send for ContainerState
impl Sync for ContainerState
impl Unpin for ContainerState
impl UnsafeUnpin for ContainerState
impl UnwindSafe for ContainerState
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