use wasmer_types::RawValue;
use crate::{AsStoreMut, Extern, VMExternToExtern};
use super::{function::VMFunction, global::VMGlobal, memory::VMMemory, table::VMTable};
pub enum VMExtern {
Function(VMFunction),
Table(VMTable),
Memory(VMMemory),
Global(VMGlobal),
}
impl VMExternToExtern for VMExtern {
fn to_extern(self, store: &mut impl AsStoreMut) -> Extern {
match self {
Self::Function(f) => Extern::Function(crate::Function::from_vm_extern(
store,
crate::vm::VMExternFunction::Jsc(f),
)),
Self::Memory(m) => Extern::Memory(crate::Memory::from_vm_extern(
store,
crate::vm::VMExternMemory::Jsc(m),
)),
Self::Global(g) => Extern::Global(crate::Global::from_vm_extern(
store,
crate::vm::VMExternGlobal::Jsc(g),
)),
Self::Table(t) => Extern::Table(crate::Table::from_vm_extern(
store,
crate::vm::VMExternTable::Jsc(t),
)),
}
}
}
pub struct VMExternRef;
impl VMExternRef {
pub fn into_raw(self) -> RawValue {
unimplemented!();
}
pub unsafe fn from_raw(_raw: RawValue) -> Option<Self> {
unimplemented!();
}
}