Enum wiggle::wasmtime_crate::StorageType
source · pub enum StorageType {
I8,
I16,
ValType(ValType),
}
Expand description
The storage type of a struct
field or array
element.
This is either a packed 8- or -16 bit integer, or else it is some unpacked Wasm value type.
Variants§
Implementations§
source§impl StorageType
impl StorageType
sourcepub fn is_val_type(&self) -> bool
pub fn is_val_type(&self) -> bool
Is this a Wasm value type?
sourcepub fn as_val_type(&self) -> Option<&ValType>
pub fn as_val_type(&self) -> Option<&ValType>
Get this storage type’s underlying value type, if any.
Returns None
if this storage type is not a value type.
sourcepub fn unwrap_val_type(&self) -> &ValType
pub fn unwrap_val_type(&self) -> &ValType
Get this storage type’s underlying value type, panicking if it is not a value type.
sourcepub fn matches(&self, other: &StorageType) -> bool
pub fn matches(&self, other: &StorageType) -> bool
Does this field type match the other field type?
That is, is this field type a subtype of the other field type?
§Panics
Panics if either type is associated with a different engine from the other.
sourcepub fn eq(a: &StorageType, b: &StorageType) -> bool
pub fn eq(a: &StorageType, b: &StorageType) -> bool
Is field type a
precisely equal to field type b
?
Returns false
even if a
is a subtype of b
or vice versa, if they
are not exactly the same field type.
§Panics
Panics if either type is associated with a different engine from the other.
Trait Implementations§
source§impl Clone for StorageType
impl Clone for StorageType
source§fn clone(&self) -> StorageType
fn clone(&self) -> StorageType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more