Skip to main content

systemconfiguration/
schema.rs

1use std::collections::BTreeMap;
2
3use serde::Deserialize;
4
5use crate::{bridge, error::Result, ffi};
6
7#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq)]
8pub struct SchemaCatalog {
9    pub reserved: BTreeMap<String, String>,
10    pub preferences: BTreeMap<String, String>,
11    pub components: BTreeMap<String, String>,
12    pub entities: BTreeMap<String, String>,
13    pub generic_properties: BTreeMap<String, String>,
14    pub ipv4: BTreeMap<String, String>,
15    pub ipv6: BTreeMap<String, String>,
16    pub dns: BTreeMap<String, String>,
17    pub proxies: BTreeMap<String, String>,
18    pub interface_types: BTreeMap<String, String>,
19}
20
21#[derive(Clone, Copy, Debug, Default)]
22pub struct Schema;
23
24impl Schema {
25    pub fn catalog() -> Result<SchemaCatalog> {
26        bridge::parse_json("sc_schema_copy_catalog", unsafe { ffi::schema::sc_schema_copy_catalog() })
27    }
28}