pub enum ValType {
I32,
I64,
F32,
F64,
V128,
Ref(RefType),
}
Expand description
Represents the types of values in a WebAssembly module.
Variants§
I32
The value type is i32.
I64
The value type is i64.
F32
The value type is f32.
F64
The value type is f64.
V128
The value type is v128.
Ref(RefType)
The value type is a reference.
Implementations§
Source§impl ValType
impl ValType
Sourcepub fn is_reference_type(&self) -> bool
pub fn is_reference_type(&self) -> bool
Returns whether this value type is a “reference type”.
Only reference types are allowed in tables, for example, and with some
instructions. Current reference types include funcref
and externref
.
Sourcepub fn as_reference_type(&self) -> Option<RefType>
pub fn as_reference_type(&self) -> Option<RefType>
Get the underlying reference type, if any.
Sourcepub fn is_defaultable(&self) -> bool
pub fn is_defaultable(&self) -> bool
Whether the type is defaultable, i.e. it is not a non-nullable reference type.
Trait Implementations§
Source§impl<'a> FromReader<'a> for ValType
impl<'a> FromReader<'a> for ValType
Source§fn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self>
fn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self>
Attempts to read
Self
from the provided binary reader, returning an
error if it is unable to do so.Source§impl Ord for ValType
impl Ord for ValType
Source§impl PartialOrd for ValType
impl PartialOrd for ValType
impl Copy for ValType
impl Eq for ValType
impl StructuralPartialEq for ValType
Auto Trait Implementations§
impl Freeze for ValType
impl RefUnwindSafe for ValType
impl Send for ValType
impl Sync for ValType
impl Unpin for ValType
impl UnwindSafe for ValType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.