Enum StorageType
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§
§impl StorageType
impl StorageType
pub fn is_val_type(&self) -> bool
pub fn is_val_type(&self) -> bool
Is this a Wasm value type?
pub 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.
pub 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.
pub fn unpack(&self) -> &ValType
pub fn unpack(&self) -> &ValType
Unpack this (possibly packed) storage type into a full ValType
.
If this is a StorageType::ValType
, then the inner ValType
is
returned as-is.
If this is a packed StorageType::I8
or StorageType::I16, then a
ValType::I32` is returned.
pub 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.
pub 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§
§impl Clone for StorageType
impl Clone for StorageType
§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§impl Display for StorageType
impl Display for StorageType
§impl From<RefType> for StorageType
impl From<RefType> for StorageType
§fn from(r: RefType) -> StorageType
fn from(r: RefType) -> StorageType
§impl From<ValType> for StorageType
impl From<ValType> for StorageType
§fn from(v: ValType) -> StorageType
fn from(v: ValType) -> StorageType
Auto Trait Implementations§
impl Freeze for StorageType
impl !RefUnwindSafe for StorageType
impl Send for StorageType
impl Sync for StorageType
impl Unpin for StorageType
impl !UnwindSafe for StorageType
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
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)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more