pub enum ExternType {
Func(FuncType),
Global(GlobalType),
Table(TableType),
Memory(MemoryType),
Tag(TagType),
}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.
Tag(TagType)
This external type is the type of a WebAssembly tag.
Implementations§
Source§impl ExternType
impl ExternType
Sourcepub fn func(&self) -> Option<&FuncType>
Available on crate feature runtime only.
pub fn func(&self) -> Option<&FuncType>
runtime only.Attempt to return the underlying type of this external type,
returning None if it is a different type.
Sourcepub fn unwrap_func(&self) -> &FuncType
Available on crate feature runtime only.
pub fn unwrap_func(&self) -> &FuncType
runtime only.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>
Available on crate feature runtime only.
pub fn global(&self) -> Option<&GlobalType>
runtime only.Attempt to return the underlying type of this external type,
returning None if it is a different type.
Sourcepub fn unwrap_global(&self) -> &GlobalType
Available on crate feature runtime only.
pub fn unwrap_global(&self) -> &GlobalType
runtime only.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>
Available on crate feature runtime only.
pub fn table(&self) -> Option<&TableType>
runtime only.Attempt to return the underlying type of this external type,
returning None if it is a different type.
Sourcepub fn unwrap_table(&self) -> &TableType
Available on crate feature runtime only.
pub fn unwrap_table(&self) -> &TableType
runtime only.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>
Available on crate feature runtime only.
pub fn memory(&self) -> Option<&MemoryType>
runtime only.Attempt to return the underlying type of this external type,
returning None if it is a different type.
Sourcepub fn unwrap_memory(&self) -> &MemoryType
Available on crate feature runtime only.
pub fn unwrap_memory(&self) -> &MemoryType
runtime only.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 tag(&self) -> Option<&TagType>
Available on crate feature runtime only.
pub fn tag(&self) -> Option<&TagType>
runtime only.Attempt to return the underlying type of this external type,
returning None if it is a different type.
Sourcepub fn unwrap_tag(&self) -> &TagType
Available on crate feature runtime only.
pub fn unwrap_tag(&self) -> &TagType
runtime only.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 default_value(&self, store: impl AsContextMut) -> Result<Extern>
Available on crate feature runtime only.
pub fn default_value(&self, store: impl AsContextMut) -> Result<Extern>
runtime only.Construct a default value, if possible, for the underlying type.
Trait Implementations§
Source§impl Clone for ExternType
Available on crate feature runtime only.
impl Clone for ExternType
runtime only.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
Available on crate feature runtime only.
impl Debug for ExternType
runtime only.Source§impl From<FuncType> for ExternType
Available on crate feature runtime only.
impl From<FuncType> for ExternType
runtime only.Source§fn from(ty: FuncType) -> ExternType
fn from(ty: FuncType) -> ExternType
Source§impl From<GlobalType> for ExternType
Available on crate feature runtime only.
impl From<GlobalType> for ExternType
runtime only.Source§fn from(ty: GlobalType) -> ExternType
fn from(ty: GlobalType) -> ExternType
Source§impl From<MemoryType> for ExternType
Available on crate feature runtime only.
impl From<MemoryType> for ExternType
runtime only.Source§fn from(ty: MemoryType) -> ExternType
fn from(ty: MemoryType) -> ExternType
Source§impl From<TableType> for ExternType
Available on crate feature runtime only.
impl From<TableType> for ExternType
runtime only.Source§fn from(ty: TableType) -> ExternType
fn from(ty: TableType) -> ExternType
Source§impl From<TagType> for ExternType
Available on crate feature runtime only.
impl From<TagType> for ExternType
runtime only.Source§fn from(ty: TagType) -> ExternType
fn from(ty: TagType) -> 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> 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§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