Pause#
One split in a task's work: a stretch of elapsed time, measured from the task start, during which the task does no work. A task holds its pauses in TaskData::pauses. Leveling writes them, and you get them back in the task updates of a LevelingResult. Create one with Pause::new or Pause::leveling.
Declaration#
With the serde feature, Pause also implements Serialize and Deserialize. by is left out of the output when it's None and is optional on input.
Fields#
| Field | Type | Description |
|---|---|---|
at |
f64 |
Where the pause starts: elapsed time after the task start, in the task's duration_unit. Must be finite and >= 0. |
length |
f64 |
How long the pause lasts: elapsed time in the task's duration_unit. Must be finite and > 0. |
by |
Option<PauseSource> |
Who wrote the pause. The leveler always sets Some(PauseSource::Leveling). Default: None. |
at and length are wall-clock time, not working time: a day is 24 hours and an hour is 60 minutes. Fractional values are allowed. On use, a pause occupies the whole minutes [round(at), round(at + length)). The two ends are rounded, not at and length separately, so adjacent pauses never overlap after rounding. A pause that rounds to zero length is ignored.
An invalid at or length fails strict validation at tasks[i].pauses[j]; see InputError. The rules for the list as a whole (sorted, non-overlapping) and the task kinds that ignore pauses are on TaskData.
Associated functions#
Pause::new#
Creates a pause with by: None.
| Name | Type | Description |
|---|---|---|
at |
f64 |
Pause start, elapsed time from the task start |
length |
f64 |
Pause length, elapsed time |
Returns a Pause with the given at and length.
Pause::leveling#
Creates a pause the way the leveler writes it: by: Some(PauseSource::Leveling).
| Name | Type | Description |
|---|---|---|
at |
f64 |
Pause start, elapsed time from the task start |
length |
f64 |
Pause length, elapsed time |
Returns a Pause with the given at and length and by set to PauseSource::Leveling.
Example#
use ;
Related#
PauseSource- records who wrote the pauseTaskData- holds a task's pausesProject::level- writes pauses into the project- Leveling Resources - when leveling splits a task with a pause instead of delaying it