1use crate::entities::{Function, Global, Memory, Table, Tag};
3use crate::store::AsStoreMut;
4pub use wasmer_vm::*;
5
6pub type VMExternTable = InternalStoreHandle<VMTable>;
8pub type VMExternMemory = InternalStoreHandle<VMMemory>;
11
12pub type VMExternGlobal = InternalStoreHandle<VMGlobal>;
14
15pub type VMExternFunction = InternalStoreHandle<VMFunction>;
17
18pub(crate) type VMExternTag = InternalStoreHandle<VMTag>;
20
21pub type VMFunctionCallback = *const VMFunctionBody;
23
24impl crate::VMExternToExtern for VMExtern {
25 fn to_extern(self, store: &mut impl AsStoreMut) -> crate::Extern {
26 match self {
27 Self::Function(f) => crate::Extern::Function(Function::from_vm_extern(
28 store,
29 crate::vm::VMExternFunction::Sys(f),
30 )),
31 Self::Memory(m) => crate::Extern::Memory(Memory::from_vm_extern(
32 store,
33 crate::vm::VMExternMemory::Sys(m),
34 )),
35 Self::Global(g) => crate::Extern::Global(Global::from_vm_extern(
36 store,
37 crate::vm::VMExternGlobal::Sys(g),
38 )),
39 Self::Table(t) => crate::Extern::Table(Table::from_vm_extern(
40 store,
41 crate::vm::VMExternTable::Sys(t),
42 )),
43 Self::Tag(t) => {
44 crate::Extern::Tag(Tag::from_vm_extern(store, crate::vm::VMExternTag::Sys(t)))
45 }
46 }
47 }
48}