Skip to main content

IValue & IType

IValue and IType are central pillars of passing values between modules and between a module and a host. Their main purpose is to allow developer not to think how this passing works internally and just use these handy enums.

rust
/// Represents values supported by interface-types.
pub enum IValue {
Boolean(bool),
S8(i8),
S16(i16),
S32(i32),
S64(i64),
U8(u8),
U16(u16),
U32(u32),
U64(u64),
F32(f32),
F64(f64),
String(String),
ByteArray(Vec<u8>), // specialization of Array for better performance
Array(Vec<IValue>),
I32(i32),
I64(i64),
Record(NEVec<IValue>),
}
rust
/// Represents values supported by interface-types.
pub enum IValue {
Boolean(bool),
S8(i8),
S16(i16),
S32(i32),
S64(i64),
U8(u8),
U16(u16),
U32(u32),
U64(u64),
F32(f32),
F64(f64),
String(String),
ByteArray(Vec<u8>), // specialization of Array for better performance
Array(Vec<IValue>),
I32(i32),
I64(i64),
Record(NEVec<IValue>),
}