feat(interface-types) Introduce RecordType for InterfaceType and Type.

The `Type::Record` variant now is defined by `RecordType`. In
addition, `InterfaceType` has a new variant: `Record`, that is also
defined by `RecordType`. Encoders and decoders are updated to consider
`RecordType`, which removes code duplication and simplify code.
This commit is contained in:
Ivan Enderlin
2020-03-26 13:17:36 +01:00
parent b528e965c5
commit 41f9c231c0
6 changed files with 384 additions and 141 deletions

View File

@ -15,9 +15,9 @@ fn test_binary_encoding_decoding_roundtrip() {
inputs: vec![InterfaceType::I32, InterfaceType::I32],
outputs: vec![InterfaceType::S32],
},
Type::Record {
Type::Record(RecordType {
fields: vec![InterfaceType::String, InterfaceType::I32],
},
}),
],
imports: vec![Import {
namespace: "a",