1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use indexmap::IndexMap;

pub mod filesystem;
pub mod loadable_device;

pub use loadable_device::LoadableDevice;

#[derive(Clone, Debug)]
pub struct Sampling {
    pub mappings: IndexMap<String, Mapping>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Mapping {
    pub result_mapping: IndexMap<String, String>,
    #[serde(default, skip_serializing_if = "IndexMap::is_empty")]
    pub curve_mapping: IndexMap<String, CurveMapping>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct CurveMapping {
    pub coordinate_system: CoordinateSystemMapping,

    #[serde(default, skip_serializing_if = "IndexMap::is_empty")]
    pub markers: IndexMap<String, CoordinateSystemMapping>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct CoordinateSystemMapping {
    pub x: String,
    pub y: String,
}