Skip to main content

amethystate_core/
scheme.rs

1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2pub enum FieldKind {
3    Plain,
4    Nested {
5        struct_name: &'static str,
6    },
7    Volatile,
8    ReactiveMap {
9        key_type: &'static str,
10        value_type: &'static str,
11        key_rust_type: &'static str,
12        value_rust_type: &'static str,
13    },
14    Lookup {
15        target_key: &'static str,
16        mutable: bool,
17    },
18    LookupNode {
19        target_prefix: &'static str,
20        struct_name: &'static str,
21    },
22}
23
24#[derive(Debug, Clone, Copy, PartialEq, Eq)]
25pub struct FieldExportMeta {
26    pub name: &'static str,
27    pub ts_type: &'static str,
28    pub full_ts_type: &'static str,
29    pub rust_type: &'static str,
30    pub kind: FieldKind,
31}
32
33#[derive(Debug, Clone, Copy, PartialEq, Eq)]
34pub struct SchemaExportEntry {
35    pub prefix: Option<&'static str>,
36    pub struct_name: &'static str,
37    pub fields: &'static [FieldExportMeta],
38}
39
40inventory::collect!(SchemaExportEntry);