Enum wasmer_types::ExternType
source · pub enum ExternType {
Function(FunctionType),
Global(GlobalType),
Table(TableType),
Memory(MemoryType),
}
Expand description
A list of all possible types which can be externally referenced from a WebAssembly module.
This list can be found in ImportType
or ExportType
, so these types
can either be imported or exported.
Variants§
Function(FunctionType)
This external type is the type of a WebAssembly function.
Global(GlobalType)
This external type is the type of a WebAssembly global.
Table(TableType)
This external type is the type of a WebAssembly table.
Memory(MemoryType)
This external type is the type of a WebAssembly memory.
Implementations§
source§impl ExternType
impl ExternType
sourcepub fn func(&self) -> Option<&FunctionType>
pub fn func(&self) -> Option<&FunctionType>
Attempt to return the underlying type of this external type,
returning None
if it is a different type.
sourcepub fn unwrap_func(&self) -> &FunctionType
pub fn unwrap_func(&self) -> &FunctionType
Returns the underlying descriptor of this ExternType
, panicking
if it is a different type.
§Panics
Panics if self
is not of the right type.
sourcepub fn global(&self) -> Option<&GlobalType>
pub fn global(&self) -> Option<&GlobalType>
Attempt to return the underlying type of this external type,
returning None
if it is a different type.
sourcepub fn unwrap_global(&self) -> &GlobalType
pub fn unwrap_global(&self) -> &GlobalType
Returns the underlying descriptor of this ExternType
, panicking
if it is a different type.
§Panics
Panics if self
is not of the right type.
sourcepub fn table(&self) -> Option<&TableType>
pub fn table(&self) -> Option<&TableType>
Attempt to return the underlying type of this external type,
returning None
if it is a different type.
sourcepub fn unwrap_table(&self) -> &TableType
pub fn unwrap_table(&self) -> &TableType
Returns the underlying descriptor of this ExternType
, panicking
if it is a different type.
§Panics
Panics if self
is not of the right type.
sourcepub fn memory(&self) -> Option<&MemoryType>
pub fn memory(&self) -> Option<&MemoryType>
Attempt to return the underlying type of this external type,
returning None
if it is a different type.
sourcepub fn unwrap_memory(&self) -> &MemoryType
pub fn unwrap_memory(&self) -> &MemoryType
Returns the underlying descriptor of this ExternType
, panicking
if it is a different type.
§Panics
Panics if self
is not of the right type.
sourcepub fn is_compatible_with(
&self,
other: &Self,
runtime_size: Option<u32>,
) -> bool
pub fn is_compatible_with( &self, other: &Self, runtime_size: Option<u32>, ) -> bool
Check if two externs are compatible
Trait Implementations§
source§impl Clone for ExternType
impl Clone for ExternType
source§fn clone(&self) -> ExternType
fn clone(&self) -> ExternType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ExternType
impl Debug for ExternType
source§impl Hash for ExternType
impl Hash for ExternType
source§impl PartialEq for ExternType
impl PartialEq for ExternType
impl Eq for ExternType
impl StructuralPartialEq for ExternType
Auto Trait Implementations§
impl Freeze for ExternType
impl RefUnwindSafe for ExternType
impl Send for ExternType
impl Sync for ExternType
impl Unpin for ExternType
impl UnwindSafe for ExternType
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> CallHasher for T
impl<T> CallHasher for 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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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
key
and return true
if they are equal.