@@ -10,6 +10,8 @@ use crate::{ident::Ident, Interface, Render, RenderOpts, World};
10
10
/// have a unique identifier that affects generated components and uniquely
11
11
/// identifiers this particular package.
12
12
#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
13
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
14
+ #[ cfg_attr( feature = "serde" , serde( rename_all = "kebab-case" ) ) ]
13
15
pub struct Package {
14
16
/// A unique name corresponding to this package.
15
17
name : PackageName ,
@@ -81,6 +83,8 @@ impl fmt::Display for Package {
81
83
}
82
84
83
85
#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
86
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
87
+ #[ cfg_attr( feature = "serde" , serde( rename_all = "kebab-case" ) ) ]
84
88
pub enum PackageItem {
85
89
Interface ( Interface ) ,
86
90
World ( World ) ,
@@ -92,6 +96,8 @@ pub enum PackageItem {
92
96
/// This is directly encoded as an "ID" in the binary component representation
93
97
/// with an interfaced tacked on as well.
94
98
#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
99
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
100
+ #[ cfg_attr( feature = "serde" , serde( rename_all = "kebab-case" ) ) ]
95
101
pub struct PackageName {
96
102
/// A namespace such as `wasi` in `wasi:foo/bar`
97
103
namespace : String ,
0 commit comments