Enum ExternType
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§
§impl ExternType
impl ExternType
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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§
§impl Clone for ExternType
impl Clone for ExternType
§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 more§impl Debug for ExternType
impl Debug for ExternType
§impl From<FuncType> for ExternType
impl From<FuncType> for ExternType
§fn from(ty: FuncType) -> ExternType
fn from(ty: FuncType) -> ExternType
§impl From<GlobalType> for ExternType
impl From<GlobalType> for ExternType
§fn from(ty: GlobalType) -> ExternType
fn from(ty: GlobalType) -> ExternType
§impl From<MemoryType> for ExternType
impl From<MemoryType> for ExternType
§fn from(ty: MemoryType) -> ExternType
fn from(ty: MemoryType) -> ExternType
§impl From<TableType> for ExternType
impl From<TableType> for ExternType
§fn from(ty: TableType) -> ExternType
fn from(ty: TableType) -> 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> 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