@@ -5,6 +5,7 @@ use crate::IdCode;
55
66/// A type of scope, as used in the `$scope` command.
77#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
8+ #[ cfg_attr( feature="serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
89#[ non_exhaustive]
910#[ allow( missing_docs) ]
1011pub enum ScopeType {
@@ -51,6 +52,7 @@ impl Display for ScopeType {
5152
5253/// A type of variable, as used in the `$var` command.
5354#[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
55+ #[ cfg_attr( feature="serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
5456#[ non_exhaustive]
5557#[ allow( missing_docs) ]
5658pub enum VarType {
@@ -136,6 +138,7 @@ impl Display for VarType {
136138
137139/// Information on a VCD scope as represented by a `$scope` command and its children.
138140#[ derive( Debug , Clone , PartialEq ) ]
141+ #[ cfg_attr( feature="serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
139142#[ non_exhaustive]
140143pub struct Scope {
141144 /// Type of scope.
@@ -186,6 +189,7 @@ impl Default for Scope {
186189/// assert_eq!("[7:0]".parse(), Ok(ReferenceIndex::Range(7, 0)));
187190/// ```
188191#[ derive( Debug , Copy , Clone , PartialEq ) ]
192+ #[ cfg_attr( feature="serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
189193pub enum ReferenceIndex {
190194 /// Single bit (e.g `[0]`)
191195 BitSelect ( i32 ) ,
@@ -245,6 +249,7 @@ fn test_parse_reference_index() {
245249
246250/// Information on a VCD variable as represented by a `$var` command.
247251#[ derive( Debug , Clone , PartialEq ) ]
252+ #[ cfg_attr( feature="serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
248253#[ non_exhaustive]
249254pub struct Var {
250255 /// Type of variable.
@@ -281,6 +286,7 @@ impl Var {
281286
282287/// An item in a scope
283288#[ derive( Debug , Clone , PartialEq ) ]
289+ #[ cfg_attr( feature="serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
284290#[ non_exhaustive]
285291pub enum ScopeItem {
286292 /// `$scope` - Child scope
0 commit comments