plen_assign#

The plen-assign crate turns a pool of workers with skills and a list of task requirements into the Slot list that Project::suggest_assignments takes. The core crate never sees skills. This crate is the only place they exist.

cargo add plen-assign

The crate depends on plen-core. It's pure Rust, with no I/O, no feature flags and no serde support. Every item is exported at the crate root.

use plen_assign::{slots, MatchError, Pool, Requirement, Skill, SkillMatch, SkillOp, Worker};

The entry point is the slots function. Pool, Worker and Skill describe who can be assigned. Requirement, SkillMatch and SkillOp describe what each task needs. MatchError is the error slots returns. It converts into plen_core::Error, so ? works inside functions that return the core error.

For a walk-through, see Skills and requirements.

  • MatchErrorThe error slots returns for an invalid pool or requirement, or a project without a baseline
  • PoolThe ordered list of workers that skill-based slots can draw resources from
  • RequirementThe staffing need of one task, as a number of slots that each need a worker matching every skill condition
  • SkillOne named skill of a pool worker, with a yes/no or graded value
  • SkillMatchOne skill condition of a requirement, comparing a worker's skill value with a threshold
  • SkillOpHow a skill match compares a worker's skill value with the match value
  • WorkerA resource in a worker pool, with the skill values it has
  • slotsBuilds suggest_assignments slots from a worker pool and task requirements