#[non_exhaustive]pub enum Extern {
Global {
ty: GlobalType,
val: WasmValue,
},
Table {
ty: TableType,
init: WasmValue,
},
Memory {
ty: MemoryType,
},
Function(Function),
}
Expand description
An external value
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Global
A global value
Fields
§
ty: GlobalType
The type of the global value.
Table
A table
Fields
Memory
A memory
Fields
§
ty: MemoryType
Defines the type of the memory, including its limits and the type of its pages.
Function(Function)
A function
Implementations§
Source§impl Extern
impl Extern
Sourcepub fn memory(ty: MemoryType) -> Self
pub fn memory(ty: MemoryType) -> Self
Create a new memory import
Sourcepub fn func(
ty: &FuncType,
func: impl Fn(FuncContext<'_>, &[WasmValue]) -> Result<Vec<WasmValue>> + 'static,
) -> Self
pub fn func( ty: &FuncType, func: impl Fn(FuncContext<'_>, &[WasmValue]) -> Result<Vec<WasmValue>> + 'static, ) -> Self
Create a new function import
Sourcepub fn typed_func<P, R>(
func: impl Fn(FuncContext<'_>, P) -> Result<R> + 'static,
) -> Selfwhere
P: FromWasmValueTuple + ValTypesFromTuple,
R: IntoWasmValueTuple + ValTypesFromTuple + Debug,
pub fn typed_func<P, R>(
func: impl Fn(FuncContext<'_>, P) -> Result<R> + 'static,
) -> Selfwhere
P: FromWasmValueTuple + ValTypesFromTuple,
R: IntoWasmValueTuple + ValTypesFromTuple + Debug,
Create a new typed function import
Sourcepub fn kind(&self) -> ExternalKind
pub fn kind(&self) -> ExternalKind
Get the kind of the external value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Extern
impl !RefUnwindSafe for Extern
impl !Send for Extern
impl !Sync for Extern
impl Unpin for Extern
impl !UnwindSafe for Extern
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.