@@ -10,6 +10,8 @@ use crate::{ident::Ident, Interface, Render, RenderOpts, World};
1010/// have a unique identifier that affects generated components and uniquely
1111/// identifiers this particular package.
1212#[ 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" ) ) ]
1315pub struct Package {
1416 /// A unique name corresponding to this package.
1517 name : PackageName ,
@@ -81,6 +83,8 @@ impl fmt::Display for Package {
8183}
8284
8385#[ 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" ) ) ]
8488pub enum PackageItem {
8589 Interface ( Interface ) ,
8690 World ( World ) ,
@@ -92,6 +96,8 @@ pub enum PackageItem {
9296/// This is directly encoded as an "ID" in the binary component representation
9397/// with an interfaced tacked on as well.
9498#[ 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" ) ) ]
95101pub struct PackageName {
96102 /// A namespace such as `wasi` in `wasi:foo/bar`
97103 namespace : String ,
0 commit comments