@@ -44,48 +44,44 @@ const DATA_SIZE: usize = 1;
44
44
/// }
45
45
/// }
46
46
/// ]
47
- ///}
48
- ///```
49
- ///
50
- /// ## Fields
51
- ///
52
- /// - `data`: The top level crate information and documentation
53
- /// - `included`: The rest of the crate information and documentation
47
+ /// }
48
+ /// ```
54
49
#[ derive( Serialize , Debug ) ]
55
50
pub struct Documentation {
51
+ /// The top level crate information and documentation
56
52
data : Option < Document > ,
53
+
54
+ /// The rest of the crate information and documentation
57
55
included : Option < Vec < Document > > ,
58
56
}
59
57
60
58
/// A sub type of the `Documentation` struct. It contains the majority of the data. It can be used
61
59
/// for both the `data` and `included` field in the serialized JSON.
62
- ///
63
- /// ## Fields
64
- ///
65
- /// - `ty`: The type of the the item (e.g. "crate", "function", "enum", etc.)
66
- /// - `id`: The unique identifier associated with this item
67
- /// - `attributes`: The attributes associated with the item like documentation or it's name
68
- /// - `relationships`: An optional field used to show the relationship between the crate to the
69
- /// otheritems in the crate
70
60
#[ derive( Serialize , Debug ) ]
71
61
pub struct Document {
72
62
#[ serde( rename = "type" ) ]
63
+ /// The type of the item (e.g. "crate", "function", "enum", etc.)
73
64
ty : String ,
65
+
66
+ /// The unique identifier associated with this item
74
67
id : String ,
68
+
69
+ /// The attributes associated with the item, like documentation or its name
75
70
attributes : HashMap < String , String > ,
71
+
72
+ /// An optional field used to show the relationship between the crate to the other items in the
73
+ /// crate
76
74
relationships : Option < HashMap < String , HashMap < String , Vec < Data > > > > ,
77
75
}
78
76
79
77
/// Used to populate the `relationships` `data` field in the serialized JSON
80
- ///
81
- /// ## Fields
82
- ///
83
- /// - `ty`: The type of the the item (e.g. "crate", "function", "enum", etc.)
84
- /// - `id`: The unique identifier associated with this item
85
78
#[ derive( Serialize , Debug ) ]
86
79
pub struct Data {
87
80
#[ serde( rename = "type" ) ]
81
+ /// The type of the item (e.g. "crate", "function", "enum", etc.)
88
82
ty : String ,
83
+
84
+ /// The unique identifier associated with this item
89
85
id : String ,
90
86
}
91
87
0 commit comments