serde_doc/
lib.rs

1
2pub mod extract;
3pub mod generators;
4
5pub struct Context {
6    pub files: Vec<FileUnit>,
7}
8
9impl Context {
10    pub fn new() -> Self {
11        Self {
12            files: Vec::new(),
13        }
14    }
15    
16}
17
18pub struct FileUnit {
19    pub structs: Vec<StructUnit>,
20    pub doc: Option<String>,
21}
22
23impl FileUnit {
24    pub fn new() -> Self {
25        Self {
26            structs: Vec::new(),
27            doc: None,
28        }
29    }
30}
31
32pub struct FieldUnit {
33    pub name: String,
34    pub ty: String,
35    pub doc: Option<String>,
36}
37
38impl FieldUnit {
39    pub fn new(name: String, ty: String, doc: Option<String>) -> Self {
40        Self { name, ty, doc }
41    }
42}
43
44pub struct StructUnit {
45    pub name: String,
46    pub fields: Vec<FieldUnit>,
47    pub derive: Vec<String>,
48    pub doc: Option<String>,
49}
50
51impl StructUnit {
52    pub fn new(name: String) -> Self {
53        Self { name, fields:Default::default(), derive:Default::default(), doc: None }
54    }
55}