Skill#

One skill of a Worker: a skill id and the worker's value for it. A SkillMatch compares against this value. There's no constructor; build it with a struct literal and put it in Worker::skills.

Declaration#

#[derive(Clone, Debug, PartialEq)]
pub struct Skill {
    pub id: Id,
    pub value: f64,
}

Fields#

Name Type Description
id Id Skill name, for example "backend". Must be unique within one worker's skills.
value f64 The worker's level in this skill: 0.0 / 1.0 for a yes/no skill, or an integer grade. Must be finite.

For the errors an invalid skill causes, see Worker.

Example#

A yes/no skill and a graded skill on one worker:

use plen_assign::{Pool, Skill, Worker};

fn main() {
    let pool = Pool {
        workers: vec![Worker {
            resource: "bob".into(),
            skills: vec![
                Skill { id: "backend".into(), value: 1.0 },
                Skill { id: "qa".into(), value: 2.0 },
            ],
        }],
    };
    println!("{pool:?}");
}
  • Worker - holds the skills in its skills list
  • SkillMatch - compares a requirement's threshold with this value
  • Pool - the list of workers passed to slots
  • Skills and Requirements - shows yes/no and graded skills in a pool