diff --git a/src/types.rs b/src/types.rs index 48ac786..2c0c66c 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,9 +1,10 @@ //! This module defines the WIT types. use crate::vec1::Vec1; +use serde::{Serialize, Deserialize}; /// Represents the types supported by WIT. -#[derive(PartialEq, Debug, Clone)] +#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)] pub enum InterfaceType { /// A 8-bits signed integer. S8, @@ -52,7 +53,7 @@ pub enum InterfaceType { } /// Represents a record type. -#[derive(PartialEq, Debug, Clone)] +#[derive(PartialEq, Debug, Clone, Serialize, Deserialize)] pub struct RecordType { /// Types representing the fields. /// A record must have at least one field, hence the diff --git a/src/vec1.rs b/src/vec1.rs index 4462beb..d9b7365 100644 --- a/src/vec1.rs +++ b/src/vec1.rs @@ -5,10 +5,11 @@ use std::{ fmt::{self, Debug}, ops, }; +use serde::{Serialize, Deserialize}; /// `Vec1` represents a non-empty `Vec`. It derefs to `Vec` /// directly. -#[derive(Clone, PartialEq)] +#[derive(Clone, PartialEq, Serialize, Deserialize)] pub struct Vec1(Vec) where T: Debug;