Pool#
The workers that may be assigned, each a project resource with its skills. A Pool is the second argument of slots. Build it with a struct literal, or start from Pool::default() (no workers). The pool isn't stored in the project: pass it again on every slots call.
Declaration#
Fields#
workers#
pub workers:
The candidate workers, one Worker per resource. The order is the tie-break preference: a slot's allowed list keeps the matching workers in pool order. A resource missing from the pool is never a candidate.
Default: empty.
Errors#
slots checks the pool before the requirements and returns Err(MatchError::Invalid) with the path below.
| When it occurs | Path |
|---|---|
| the worker's resource isn't a resource of the project | pool.workers[i].resource |
two workers name the same resource (ids compare by Id key) |
pool.workers[i].resource |
Errors in a worker's skill list are on Worker.
Example#
use ;
use ;
Output:
be#1: ["bob", "ann"]
Related#
Worker- one entry of the poolRequirement- the requirements matched against the pool's workersslots- takes the pool and builds the slots- Skills and Requirements - shows how to build a pool of skilled workers