feat(uci): support repeated sections and skipped fields
Allow structured lists to share the existing UCI configuration adapter while keeping collection fields out of scalar section mappings.
This commit is contained in:
1 parent
8c923f373d
commit
76a7e14835
3 files changed
+124
-25
No files matched your search
@@ -19,6 +19,18 @@ pub(crate) struct UciSectionMapping {
|
||||
pub(crate) options: &'static [UciOptionMapping],
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "uci", unix))]
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub(crate) struct UciRepeatedSectionMapping {
|
||||
/// UCI section type, for both named and anonymous sections.
|
||||
pub(crate) uci_section: &'static str,
|
||||
|
||||
/// Config-rs / Serde path receiving an array of section tables.
|
||||
pub(crate) config_path: &'static str,
|
||||
|
||||
pub(crate) options: &'static [UciOptionMapping],
|
||||
}
|
||||
|
||||
pub(crate) trait UciSectionSchema {
|
||||
const UCI_OPTIONS: &'static [UciOptionMapping];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user