matc/clusters/codec/
schema.rs

1// Shared types for runtime-introspectable command schemas.
2// Referenced by generated per-cluster codec files and by matc consumers.
3
4#[derive(Clone, Debug, serde::Serialize)]
5pub struct CommandField {
6    pub tag: u32,
7    pub name: &'static str,
8    pub kind: FieldKind,
9    pub optional: bool,
10    pub nullable: bool,
11}
12
13#[derive(Clone, Debug, serde::Serialize)]
14#[serde(tag = "type", rename_all = "snake_case")]
15pub enum FieldKind {
16    U8,
17    U16,
18    U32,
19    U64,
20    I8,
21    I16,
22    I32,
23    I64,
24    Bool,
25    String,
26    OctetString,
27    Enum {
28        name: &'static str,
29        variants: &'static [(u32, &'static str)],
30    },
31    Bitmap {
32        name: &'static str,
33        bits: &'static [(u32, &'static str)],
34    },
35    Struct {
36        name: &'static str,
37    },
38    List {
39        entry_type: &'static str,
40    },
41}