mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 13:18:20 +00:00
feat(api,emscritpen,wasi) Update WasmExternType to FromToNativeWasmType.
This commit is contained in:
2
lib/api/src/externals/mod.rs
vendored
2
lib/api/src/externals/mod.rs
vendored
@@ -3,7 +3,7 @@ mod global;
|
||||
mod memory;
|
||||
mod table;
|
||||
|
||||
pub use self::function::{Function, HostFunction, WasmExternType, WasmTypeList};
|
||||
pub use self::function::{FromToNativeWasmType, Function, HostFunction, WasmTypeList};
|
||||
pub use self::global::Global;
|
||||
pub use self::memory::Memory;
|
||||
pub use self::table::Table;
|
||||
|
||||
@@ -19,7 +19,7 @@ mod utils;
|
||||
|
||||
pub use crate::exports::{ExportError, Exportable, Exports};
|
||||
pub use crate::externals::{
|
||||
Extern, Function, Global, HostFunction, Memory, Table, WasmExternType, WasmTypeList,
|
||||
Extern, FromToNativeWasmType, Function, Global, HostFunction, Memory, Table, WasmTypeList,
|
||||
};
|
||||
pub use crate::import_object::{ImportObject, ImportObjectIterator, LikeNamespace};
|
||||
pub use crate::instance::Instance;
|
||||
|
||||
@@ -13,7 +13,7 @@ use crate::externals::function::{
|
||||
FunctionDefinition, HostFunctionDefinition, VMDynamicFunction, VMDynamicFunctionWithEnv,
|
||||
VMDynamicFunctionWithoutEnv, WasmFunctionDefinition,
|
||||
};
|
||||
use crate::{Function, FunctionType, RuntimeError, Store, WasmExternType, WasmTypeList};
|
||||
use crate::{FromToNativeWasmType, Function, FunctionType, RuntimeError, Store, WasmTypeList};
|
||||
use std::panic::{catch_unwind, AssertUnwindSafe};
|
||||
use wasm_common::NativeWasmType;
|
||||
use wasmer_runtime::{
|
||||
@@ -97,7 +97,7 @@ macro_rules! impl_native_traits {
|
||||
#[allow(unused_parens, non_snake_case)]
|
||||
impl<'a $( , $x )*, Rets> NativeFunc<'a, ( $( $x ),* ), Rets>
|
||||
where
|
||||
$( $x: WasmExternType, )*
|
||||
$( $x: FromToNativeWasmType, )*
|
||||
Rets: WasmTypeList,
|
||||
{
|
||||
/// Call the typed func and return results.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
//! Therefore, you should use this abstraction whenever possible to avoid memory
|
||||
//! related bugs when implementing an ABI.
|
||||
|
||||
use crate::{externals::Memory, WasmExternType};
|
||||
use crate::{externals::Memory, FromToNativeWasmType};
|
||||
use std::{cell::Cell, fmt, marker::PhantomData, mem};
|
||||
use wasm_common::ValueType;
|
||||
|
||||
@@ -218,7 +218,7 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: Copy, Ty> WasmExternType for WasmPtr<T, Ty> {
|
||||
unsafe impl<T: Copy, Ty> FromToNativeWasmType for WasmPtr<T, Ty> {
|
||||
type Native = i32;
|
||||
|
||||
fn to_native(self) -> Self::Native {
|
||||
|
||||
Reference in New Issue
Block a user