pub enum WorkerState {
Spawning,
Ready,
Busy {
started_at: Instant,
},
Recycling {
reason: RecycleReason,
},
Dead {
exit_code: Option<i32>,
},
}Expand description
Lifecycle states for a worker process.
Transitions:
- Spawning -> Ready (successful startup handshake)
- Ready -> Busy (test execution started)
- Busy -> Ready (test execution completed successfully)
- Busy -> Recycling (max runs reached or error)
- Ready -> Recycling (explicit shutdown or max runs)
- Recycling -> Dead (process exited)
- Spawning -> Dead (startup failed)
Variants§
Spawning
Worker process is starting up.
Ready
Worker is idle and ready to accept work.
Busy
Worker is currently executing tests.
Recycling
Worker is being recycled and should not accept new work.
Fields
§
reason: RecycleReasonDead
Worker process has exited.
Implementations§
Source§impl WorkerState
impl WorkerState
Sourcepub fn is_alive(&self) -> bool
pub fn is_alive(&self) -> bool
Returns true if the worker process is still alive (Spawning, Ready, or Busy).
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true if the worker has been recycled or is dead.
Sourcepub fn transition_to(self, next: WorkerState) -> Result<WorkerState>
pub fn transition_to(self, next: WorkerState) -> Result<WorkerState>
Attempt to transition to a new state. Returns the new state on success, or an error if the transition is invalid.
Trait Implementations§
Source§impl Clone for WorkerState
impl Clone for WorkerState
Source§fn clone(&self) -> WorkerState
fn clone(&self) -> WorkerState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkerState
impl Debug for WorkerState
impl Eq for WorkerState
Source§impl PartialEq for WorkerState
impl PartialEq for WorkerState
impl StructuralPartialEq for WorkerState
Auto Trait Implementations§
impl Freeze for WorkerState
impl RefUnwindSafe for WorkerState
impl Send for WorkerState
impl Sync for WorkerState
impl Unpin for WorkerState
impl UnsafeUnpin for WorkerState
impl UnwindSafe for WorkerState
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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