feat(interface-types) Update interface types.

According to the last working notes, new interface types are s8, s16,
s32, s64, u8, u16, u32, u64, f32, f64, string, anyref, i32, and i64.

Their binary reprensentations are changing too, from 0x00 to 0x0d.
This commit is contained in:
Ivan Enderlin
2020-02-24 15:37:03 +01:00
parent 2d7cd2b52a
commit 09e57b7156
6 changed files with 357 additions and 272 deletions

View File

@ -7,26 +7,29 @@ use std::str;
/// Represents the types supported by WIT.
#[derive(PartialEq, Debug)]
pub enum InterfaceType {
/// An integer.
Int,
/// A 8-bits signed integer.
S8,
/// A float.
Float,
/// A 16-bits signed integer.
S16,
/// Opaque reference.
Any,
/// A 32-bits signed integer.
S32,
/// A string.
String,
/// A 64-bits signed integer.
S64,
/// A sequence.
Seq,
/// A 8-bits unsigned integer.
U8,
/// A 32-bits integer.
I32,
/// A 16-bits unsigned integer.
U16,
/// A 64-bits integer.
I64,
/// A 32-bits unsigned integer.
U32,
/// A 64-bits unsigned integer.
U64,
/// A 32-bits float.
F32,
@ -34,8 +37,17 @@ pub enum InterfaceType {
/// A 64-bits float.
F64,
/// A stirng.
String,
/// An `any` reference.
AnyRef,
Anyref,
/// A 32-bits integer (as defined in WebAssembly core).
I32,
/// A 64-bits integer (as defiend in WebAssembly core).
I64,
}
/// Represents the kind of adapter.