[Canonical page](<https://docs.dhtmlx.com/planning-engine/rust/api/assign/skill/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# Skill

One skill of a [`Worker`](<https://docs.dhtmlx.com/planning-engine/rust/api/assign/worker.md>): a skill id and the worker's value for it. A [`SkillMatch`](<https://docs.dhtmlx.com/planning-engine/rust/api/assign/skill-match.md>) compares against this value. There's no constructor; build it with a struct literal and put it in [`Worker::skills`](<https://docs.dhtmlx.com/planning-engine/rust/api/assign/worker.md#skills>).

## Declaration

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

## Fields

| Name | Type | Description |
|---|---|---|
| `id` | [`Id`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/data/id.md>) | 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`](<https://docs.dhtmlx.com/planning-engine/rust/api/assign/worker.md#errors>).

## Example

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

```rust
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:?}");
}
```

## Related

- [`Worker`](<https://docs.dhtmlx.com/planning-engine/rust/api/assign/worker.md>) - holds the skills in its `skills` list
- [`SkillMatch`](<https://docs.dhtmlx.com/planning-engine/rust/api/assign/skill-match.md>) - compares a requirement's threshold with this value
- [`Pool`](<https://docs.dhtmlx.com/planning-engine/rust/api/assign/pool.md>) - the list of workers passed to `slots`
- [Skills and Requirements](<https://docs.dhtmlx.com/planning-engine/rust/resources-and-assignment/skills-and-requirements.md>) - shows yes/no and graded skills in a pool
