Merge branch 'master' into feat-deprecated-runtime-core

This commit is contained in:
Ivan Enderlin
2020-07-16 13:27:59 +02:00
61 changed files with 1511 additions and 138 deletions

View File

@@ -15,15 +15,24 @@ use crate::store::{Store, StoreObject};
use crate::ExternType;
use wasmer_vm::Export;
/// An `Extern` 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()),