#[repr(u8)]pub enum WorkerStatus {
Pending = 0,
Ready = 1,
NotReady = 2,
Failed = 3,
Draining = 4,
}Expand description
Worker lifecycle status, modeled after Kubernetes pod conditions.
Separates “starting up” from “can serve traffic” from “broken” to prevent premature removal of workers that haven’t been locally verified.
Uses #[repr(u8)] with explicit discriminants so atomic storage
(AtomicU8) and wire compatibility do not depend on enum ordering.
Variants§
Pending = 0
Just registered, not yet proven healthy locally. Not routable. Health checker probes until first success.
Ready = 1
Locally verified and passing health checks. Routable.
NotReady = 2
Was Ready, now failing readiness checks. Not routable. NOT removed — may recover. Health checker continues probing.
Failed = 3
Sustained liveness failure. Will be removed if --remove-unhealthy-workers.
Draining = 4
Marked for removal (e.g. K8s pod has deletionTimestamp). Excluded
from selection so no new traffic is routed, but kept in the registry
so in-flight requests can complete before the worker is removed.
Implementations§
Source§impl WorkerStatus
impl WorkerStatus
Sourcepub fn try_from_u8(value: u8) -> Option<Self>
pub fn try_from_u8(value: u8) -> Option<Self>
Try to convert a u8 discriminant to a WorkerStatus.
Returns None for unrecognized values.
Sourcepub fn from_u8(value: u8) -> Self
pub fn from_u8(value: u8) -> Self
Convert a u8 discriminant to a WorkerStatus, falling back to
Pending for unrecognized values (with a debug assertion).
Sourcepub fn is_routable(self) -> bool
pub fn is_routable(self) -> bool
Returns true if the worker is routable (only Ready).
Trait Implementations§
Source§impl Clone for WorkerStatus
impl Clone for WorkerStatus
Source§fn clone(&self) -> WorkerStatus
fn clone(&self) -> WorkerStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WorkerStatus
Source§impl Debug for WorkerStatus
impl Debug for WorkerStatus
Source§impl Default for WorkerStatus
impl Default for WorkerStatus
Source§fn default() -> WorkerStatus
fn default() -> WorkerStatus
Source§impl<'de> Deserialize<'de> for WorkerStatus
impl<'de> Deserialize<'de> for WorkerStatus
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for WorkerStatus
impl Display for WorkerStatus
impl Eq for WorkerStatus
Source§impl Hash for WorkerStatus
impl Hash for WorkerStatus
Source§impl JsonSchema for WorkerStatus
impl JsonSchema for WorkerStatus
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for WorkerStatus
impl PartialEq for WorkerStatus
Source§impl Serialize for WorkerStatus
impl Serialize for WorkerStatus
impl StructuralPartialEq for WorkerStatus
Auto Trait Implementations§
impl Freeze for WorkerStatus
impl RefUnwindSafe for WorkerStatus
impl Send for WorkerStatus
impl Sync for WorkerStatus
impl Unpin for WorkerStatus
impl UnsafeUnpin for WorkerStatus
impl UnwindSafe for WorkerStatus
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.