ftd-rt 0.1.5

ftd-rt: Utility crate for ftd
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize)]
pub struct Condition {
    pub variable: String,
    pub value: String,
}

impl Condition {
    pub fn is_true(&self, data: &ftd_rt::DataDependenciesMap) -> bool {
        if let Some(ftd_rt::Data { value: v, .. }) = data.get(self.variable.as_str()) {
            return v == &self.value;
        }

        true
    }
}