Skip to main content

ContainerState

Struct ContainerState 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn drain_pending_fetches(&mut self) -> Vec<String>

Take the full fetch queue, leaving it empty.

Source

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

Source§

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

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

impl Default for ContainerState

Source§

fn default() -> ContainerState

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