mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 05:08:19 +00:00
Added spec docs to app API public objects
This commit is contained in:
9
lib/api/src/externals/mod.rs
vendored
9
lib/api/src/externals/mod.rs
vendored
@@ -15,15 +15,24 @@ use crate::store::{Store, StoreObject};
|
||||
use crate::ExternType;
|
||||
use wasmer_vm::Export;
|
||||
|
||||
/// An external value is the runtime representation of an entity that
|
||||
/// can be imported or exported.
|
||||
///
|
||||
/// Spec: https://webassembly.github.io/spec/core/exec/runtime.html#external-values
|
||||
#[derive(Clone)]
|
||||
pub enum Extern {
|
||||
/// A external [`Function`]
|
||||
Function(Function),
|
||||
/// A external [`Global`]
|
||||
Global(Global),
|
||||
/// A external [`Table`]
|
||||
Table(Table),
|
||||
/// A external [`Memory`]
|
||||
Memory(Memory),
|
||||
}
|
||||
|
||||
impl Extern {
|
||||
/// Return the undelying type of the inner `Extern`.
|
||||
pub fn ty(&self) -> ExternType {
|
||||
match self {
|
||||
Extern::Function(ft) => ExternType::Function(ft.ty().clone()),
|
||||
|
||||
Reference in New Issue
Block a user