LinkType#

The dependency kind of a link: which end of the source task constrains which end of the target task. It's the type of LinkData::link_type, LinkAdd::link_type and LinkUpdate::link_type. The default is LinkType::Fs.

Declaration#

#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub enum LinkType {
    #[default]
    Fs,
    Ss,
    Ff,
    Sf,
}

Variants#

Variant Description
Fs Finish-to-start (default). The source's finish constrains the target's start.
Ss Start-to-start. The source's start constrains the target's start.
Ff Finish-to-finish. The source's finish constrains the target's finish.
Sf Start-to-finish. The source's start constrains the target's finish.

The offset between the two ends is the link's lag; see LinkData.

Example#

use plen_core::{LinkData, LinkType};

fn main() {
    let link = LinkData {
        id: 1.into(),
        source: 10.into(),
        target: 11.into(),
        link_type: LinkType::Ss,
        lag: 0.0,
        lag_unit: None,
    };
    assert_eq!(link.link_type, LinkType::Ss);
    assert_eq!(LinkType::default(), LinkType::Fs);
}