Skip to main content

nominal_api_conjure/conjure/objects/scout/dataexport/api/
matfile.rs

1/// Export settings for a `.mat` file compatible with matlab.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct Matfile {
17    #[builder(default, into)]
18    #[serde(
19        rename = "structHierarchicalDelimiter",
20        skip_serializing_if = "Option::is_none",
21        default
22    )]
23    struct_hierarchical_delimiter: Option<String>,
24}
25impl Matfile {
26    /// Constructs a new instance of the type.
27    #[inline]
28    pub fn new() -> Self {
29        Self::builder().build()
30    }
31    /// If present, exported column names are split on this single-character delimiter and written as nested
32    /// MATLAB structs. If absent, MATLAB export preserves the existing flat field behavior.
33    ///
34    /// When this option is set, requested channel names must produce valid struct paths after splitting:
35    /// - the delimiter must be exactly one character;
36    /// - no path segment may be empty;
37    /// - the first path segment may not be `timestamps`, which is reserved for the generated timestamp column;
38    /// - no two channels may resolve to the same path;
39    /// - no channel may resolve to both a leaf and an object path, such as `a.b` and `a.b.c`.
40    ///
41    /// If a grouped export produces multiple output columns for one requested channel, tag names and values
42    /// are appended to the final leaf field name only. The delimiter is not applied to those tag suffixes.
43    ///
44    /// Other channel name segments are preserved as-is. Segments that are not valid MATLAB identifiers may
45    /// require dynamic field access in MATLAB.
46    #[inline]
47    pub fn struct_hierarchical_delimiter(&self) -> Option<&str> {
48        self.struct_hierarchical_delimiter.as_ref().map(|o| &**o)
49    }
50}