pub enum SessionStatus {
Registered,
Starting,
Running,
Stopping,
Exited {
exit_code: Option<i32>,
},
Failed {
message: String,
},
}Variants§
Implementations§
Source§impl SessionStatus
impl SessionStatus
Sourcepub fn allows_remove(&self) -> bool
pub fn allows_remove(&self) -> bool
Whether a Remove command for a session in this status will be
accepted rather than rejected as an invalid transition.
It lives here, on the status itself, because two crates need the
same answer and neither may depend on the other: gate4agent-engine
enforces it in Gate4AgentEngine::remove, and gate4agent-node
consults it in wait_until_removed BEFORE re-dispatching, because a
rejected command is not free – it publishes a ControlEventKind:: CommandRejected to every subscriber and writes a WARN line. Ungated,
one ordinary teardown produced 241 rejections in 1.6 seconds: the
entire Stopping window at one known-doomed dispatch per 2ms tick.
Exhaustive on purpose – a status added to this enum without a decision here fails to compile rather than silently joining one set.