Enum wasmtime::ExternType
source · [−]pub enum ExternType {
Func(FuncType),
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
Func(FuncType)
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
sourceimpl ExternType
impl ExternType
sourcepub fn func(&self) -> Option<&FuncType>
pub fn func(&self) -> Option<&FuncType>
Attempt to return the underlying type of this external type,
returning None
if it is a different type.
sourcepub fn unwrap_func(&self) -> &FuncType
pub fn unwrap_func(&self) -> &FuncType
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.
Trait Implementations
sourceimpl Clone for ExternType
impl Clone for ExternType
sourcefn clone(&self) -> ExternType
fn clone(&self) -> ExternType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ExternType
impl Debug for ExternType
sourceimpl From<FuncType> for ExternType
impl From<FuncType> for ExternType
sourcefn from(ty: FuncType) -> ExternType
fn from(ty: FuncType) -> ExternType
Performs the conversion.
sourceimpl From<GlobalType> for ExternType
impl From<GlobalType> for ExternType
sourcefn from(ty: GlobalType) -> ExternType
fn from(ty: GlobalType) -> ExternType
Performs the conversion.
sourceimpl From<MemoryType> for ExternType
impl From<MemoryType> for ExternType
sourcefn from(ty: MemoryType) -> ExternType
fn from(ty: MemoryType) -> ExternType
Performs the conversion.
sourceimpl From<TableType> for ExternType
impl From<TableType> for ExternType
sourcefn from(ty: TableType) -> ExternType
fn from(ty: TableType) -> ExternType
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for ExternType
impl Send for ExternType
impl Sync for ExternType
impl Unpin for ExternType
impl UnwindSafe for ExternType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more