pub enum WasmValue {
I32(i32),
I64(i64),
F32(f32),
F64(f64),
V128(i128),
RefExtern(ExternRef),
RefFunc(FuncRef),
}Expand description
A WebAssembly value.
See https://webassembly.github.io/spec/core/syntax/types.html#value-types
Variants§
I32(i32)
A 32-bit integer.
I64(i64)
A 64-bit integer.
F32(f32)
A 32-bit float.
F64(f64)
A 64-bit float.
V128(i128)
RefExtern(ExternRef)
RefFunc(FuncRef)
Implementations§
Source§impl WasmValue
impl WasmValue
Sourcepub fn const_instr(&self) -> Box<[ConstInstruction]>
pub fn const_instr(&self) -> Box<[ConstInstruction]>
Get the matching ConstInstruction for this value.
Sourcepub const fn default_for(ty: WasmType) -> Self
pub const fn default_for(ty: WasmType) -> Self
Get the default value for a given type.
Sourcepub fn eq_loose(&self, other: &Self) -> bool
pub fn eq_loose(&self, other: &Self) -> bool
Check if two values are equal, ignoring differences in NaN values.
Sourcepub const fn as_ref_extern(&self) -> Option<ExternRef>
pub const fn as_ref_extern(&self) -> Option<ExternRef>
Return the [ExternRef] from a WasmValue, if it is one
Sourcepub const fn as_ref_func(&self) -> Option<FuncRef>
pub const fn as_ref_func(&self) -> Option<FuncRef>
Return the FuncRef from a WasmValue, if it is one
Trait Implementations§
impl Copy for WasmValue
impl StructuralPartialEq for WasmValue
Auto Trait Implementations§
impl Freeze for WasmValue
impl RefUnwindSafe for WasmValue
impl Send for WasmValue
impl Sync for WasmValue
impl Unpin for WasmValue
impl UnsafeUnpin for WasmValue
impl UnwindSafe for WasmValue
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