pub enum ValueType {
I32,
I64,
F32,
F64,
FunctionReference,
ExternalReference,
}Expand description
Value types classify the individual values that WebAssembly code can compute with and the values that a variable accepts. They are either number types or reference types.
See https://webassembly.github.io/spec/core/syntax/types.html#value-types
§Examples
use wasm_ast::{ValueType, ReferenceType, IntegerType, FloatType, NumberType};
assert_eq!(ValueType::I32, IntegerType::I32.into());
assert_eq!(ValueType::I32, NumberType::I32.into());
assert_eq!(ValueType::I64, IntegerType::I64.into());
assert_eq!(ValueType::I64, NumberType::I64.into());
assert_eq!(ValueType::F32, FloatType::F32.into());
assert_eq!(ValueType::F32, NumberType::F32.into());
assert_eq!(ValueType::F64, FloatType::F64.into());
assert_eq!(ValueType::F64, NumberType::F64.into());
assert_eq!(ValueType::FunctionReference, ReferenceType::Function.into());
assert_eq!(ValueType::ExternalReference, ReferenceType::External.into());Variants§
Trait Implementations§
Source§impl From<ReferenceType> for ValueType
impl From<ReferenceType> for ValueType
Source§fn from(kind: ReferenceType) -> Self
fn from(kind: ReferenceType) -> Self
Converts to this type from the input type.
impl Copy for ValueType
impl Eq for ValueType
impl StructuralPartialEq for ValueType
Auto Trait Implementations§
impl Freeze for ValueType
impl RefUnwindSafe for ValueType
impl Send for ValueType
impl Sync for ValueType
impl Unpin for ValueType
impl UnwindSafe for ValueType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more