rust_code_visualizer/
structures.rs1#[derive(Debug, Eq, PartialEq)]
2pub enum Element {
3 Struct(StructElement),
4 Enum(EnumElement),
5}
6
7#[derive(Debug, Eq, PartialEq)]
8pub struct StructElement {
9 pub name: String,
10 pub fields: Vec<Field>,
11}
12
13#[derive(Debug, Eq, PartialEq)]
14pub struct EnumElement {
15 pub name: String,
16 pub variants: Vec<Variant>,
17}
18
19#[derive(Debug, Eq, PartialEq)]
20pub struct Variant {
21 pub name: String,
22 pub fields: Vec<Field>,
23}
24
25#[derive(Debug, Eq, PartialEq)]
26pub enum Type {
27 Simple(String),
28 Vec(Box<Type>),
29 Tuple(Vec<Type>),
30 Other(Box<Type>),
31}
32
33#[derive(Debug, Eq, PartialEq)]
34pub struct Field {
35 pub name: Option<String>,
43 pub ty: Type,
44}