TaskSlack#
The total and free slack of one task. It isn't built by hand. Read it from Analytics::slack, which is Some when the run asked for it with AnalyticsOptions::slack. For how slack is computed and which tasks get an entry, see Critical path and slack.
Declaration#
With the serde feature, it also implements Serialize and Deserialize.
Fields#
| Name | Type | Description |
|---|---|---|
task |
Id |
Id of the task. |
total |
f64 |
Total slack: how far the task can slip before the project finish moves. Zero or negative on a critical task. |
free |
f64 |
Free slack: how far the task can slip before it pushes a successor. Never more than total, and equal to total when the task has no successors. |
Both values are in the configured TimeUnit (duration_unit in SchedulingConfig) and count working time on the task's calendar. A completed task (with use_progress and progress == 1) reports 0.0 for both.
Serialization#
With the serde feature, a TaskSlack serializes as:
Example#
Schedule two tasks that both wait for a third, then print each task's slack.
use ;
Related#
Analytics- holds the slack listCritical- the critical path computed next to slackAnalyticsOptions- requests slack- Critical path and slack - explains how slack is computed