pub struct WorkerInfo {
pub id: String,
pub name: String,
pub tags: Vec<String>,
pub gpu: bool,
pub cpu_cores: usize,
pub active_jobs: usize,
pub max_concurrent: usize,
}Expand description
A worker’s capabilities and current load.
Fields§
§id: StringStable identifier assignments and transfers refer to.
name: StringHuman-readable name, carried into Assignment::worker_name so a
distribution plan reads without a worker lookup.
Capability tags (e.g. "gpu") matched against a plan’s
RemoteTarget::Tag requirements.
gpu: boolWhether the worker has a GPU.
cpu_cores: usizeCPU cores available on the worker.
active_jobs: usizeJobs currently running; the load side of available_slots.
max_concurrent: usizeUpper bound on concurrent jobs; the capacity side of
available_slots.
Implementations§
Source§impl WorkerInfo
impl WorkerInfo
Sourcepub fn available_slots(&self) -> usize
pub fn available_slots(&self) -> usize
How many more jobs this worker can take right now. Saturates at zero: a worker reporting more active jobs than its limit is full, not underflowed.
Sourcepub fn has_capacity(&self) -> bool
pub fn has_capacity(&self) -> bool
Whether the worker can take at least one more job. schedule
filters on this before any placement is attempted.
Sourcepub fn matches_tag(&self, tag: &str) -> bool
pub fn matches_tag(&self, tag: &str) -> bool
Whether the worker advertises tag among its capability tags.
Trait Implementations§
Source§impl Clone for WorkerInfo
impl Clone for WorkerInfo
Source§fn clone(&self) -> WorkerInfo
fn clone(&self) -> WorkerInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more