TaskType#

Kind of a task: a regular task, a summary or a milestone. It's the type of the TaskData::task_type field, which defaults to TaskType::Task.

Declaration#

#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum TaskType {
    #[default]
    Task,
    Summary,
    Milestone,
}

Variants#

Variant Description
Task Default. A regular task with its own work.
Summary Groups the tasks whose parent is this task. Its span is rolled up from its children.
Milestone A zero-span marker in the schedule. It books no resource load.

For the date fields each kind accepts, see TaskData. Schedule results report the kind in Mutation::kind.

Example#

A summary with one task and a closing milestone:

use plen_core::{TaskData, TaskType};

fn main() {
    let mut phase = TaskData::new("phase");
    phase.task_type = TaskType::Summary;

    let mut build = TaskData::new("build");
    build.parent = Some("phase".into());
    build.duration = Some(5.0);

    let mut release = TaskData::new("release");
    release.parent = Some("phase".into());
    release.task_type = TaskType::Milestone;

    assert_eq!(build.task_type, TaskType::Task);
    println!("{phase:?}\n{build:?}\n{release:?}");
}