#[non_exhaustive]pub enum WorkerEvent {
Spawned {
pid: u32,
},
Waiting,
Responded {
bytes: usize,
elapsed: Duration,
},
Exited {
code: Option<i32>,
success: bool,
},
TimedOut,
}Expand description
One parent-side lifecycle fact from WorkerCommand::run_observed.
Order for a child that was spawned: Spawned, Waiting, then either TimedOut followed by
Exited (the parent’s deadline killed it) or Exited followed by TimedOut (the child’s own
watchdog exited with SELF_DEADLINE_EXIT), and finally Responded. Every spawned child
yields exactly one Exited. A run that never spawned emits no events.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Spawned
The child started. pid is its process id, for host diagnostics.
Waiting
The request was handed to the child and the parent is waiting within its deadline.
Responded
The child’s stdout was captured. bytes is the captured length (up to the protocol limit)
and elapsed is measured from spawn.
Exited
The child was reaped. code is None when it was killed by a signal or its status could
not be read; success is true only for a zero exit.
TimedOut
The run ran out of time: the parent’s deadline, or the child’s watchdog exit code.