pub struct ContainerState { /* private fields */ }Expand description
Always-present container-domain state: cache and cross-host pending operations.
Separate from ContainerSession, which is the per-host overlay session state.
Implementations§
Source§impl ContainerState
impl ContainerState
pub fn cache(&self) -> &HashMap<String, ContainerCacheEntry>
pub fn set_cache(&mut self, cache: HashMap<String, ContainerCacheEntry>)
pub fn cache_entry(&self, alias: &str) -> Option<&ContainerCacheEntry>
pub fn cache_entry_mut( &mut self, alias: &str, ) -> Option<&mut ContainerCacheEntry>
pub fn cache_contains(&self, alias: &str) -> bool
pub fn cache_len(&self) -> usize
pub fn insert_cache_entry(&mut self, alias: String, entry: ContainerCacheEntry)
pub fn remove_cache_entry(&mut self, alias: &str)
pub fn clear_cache(&mut self)
pub fn pending_exec_request(&self) -> Option<&ContainerExecRequest>
pub fn pending_logs_request(&self) -> Option<&ContainerLogsRequest>
pub fn has_pending_fetches(&self) -> bool
pub fn pending_actions_len(&self) -> usize
pub fn take_pending_exec(&mut self) -> Option<ContainerExecRequest>
pub fn take_pending_logs(&mut self) -> Option<ContainerLogsRequest>
pub fn pop_next_action(&mut self) -> Option<ContainerActionRequest>
pub fn pending_actions_iter( &self, ) -> impl Iterator<Item = &ContainerActionRequest>
pub fn pending_actions_at(&self, idx: usize) -> Option<&ContainerActionRequest>
pub fn pending_fetch_aliases(&self) -> &[String]
pub fn extend_pending_fetches<I: IntoIterator<Item = String>>( &mut self, iter: I, )
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