simconnect_sdk/domain/
condition.rs

1use crate::bindings;
2
3/// Specifies under which conditions the data is to be sent by the server and received by the client.
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub enum Condition {
6    /// The default, data will be sent strictly according to the defined period.
7    None,
8    /// Data will only be sent to the client when one or more values have changed. All the variables in a data definition will be returned if just one of the values changes.
9    Changed,
10}
11
12impl From<Condition> for u32 {
13    fn from(condition: Condition) -> Self {
14        match condition {
15            Condition::None => 0,
16            Condition::Changed => bindings::SIMCONNECT_DATA_REQUEST_FLAG_CHANGED,
17        }
18    }
19}