[−]Trait wasmer_runtime::types::WasmExternType
A trait to convert a Rust value to a WasmNativeType value,
or to convert WasmNativeType value to a Rust value.
This trait should ideally be splitted into two traits:
FromNativeWasmType and ToNativeWasmType but it creates a
non-negligeable complexity in the WasmTypeList
implementation.
Associated Types
type Native: NativeWasmType
Native Wasm type.
Required methods
fn from_native(native: Self::Native) -> Self
Convert a value of kind Self::Native to Self.
Panics
This method panics if native cannot fit in the Self
type`.
fn to_native(self) -> Self::Native
Convert self to Self::Native.
Panics
This method panics if self cannot fit in the
Self::Native type.
Implementations on Foreign Types
impl FromToNativeWasmType for f32
type Native = f32
fn from_native(native: <f32 as FromToNativeWasmType>::Native) -> f32
fn to_native(self) -> <f32 as FromToNativeWasmType>::Native
impl FromToNativeWasmType for f64
type Native = f64
fn from_native(native: <f64 as FromToNativeWasmType>::Native) -> f64
fn to_native(self) -> <f64 as FromToNativeWasmType>::Native
impl FromToNativeWasmType for u16
type Native = i32
fn from_native(native: <u16 as FromToNativeWasmType>::Native) -> u16
fn to_native(self) -> <u16 as FromToNativeWasmType>::Native
impl FromToNativeWasmType for u8
type Native = i32
fn from_native(native: <u8 as FromToNativeWasmType>::Native) -> u8
fn to_native(self) -> <u8 as FromToNativeWasmType>::Native
impl FromToNativeWasmType for i16
type Native = i32
fn from_native(native: <i16 as FromToNativeWasmType>::Native) -> i16
fn to_native(self) -> <i16 as FromToNativeWasmType>::Native
impl FromToNativeWasmType for i8
type Native = i32
fn from_native(native: <i8 as FromToNativeWasmType>::Native) -> i8
fn to_native(self) -> <i8 as FromToNativeWasmType>::Native
impl FromToNativeWasmType for u64
type Native = i64
fn from_native(native: <u64 as FromToNativeWasmType>::Native) -> u64
fn to_native(self) -> <u64 as FromToNativeWasmType>::Native
impl FromToNativeWasmType for u32
type Native = i32
fn from_native(native: <u32 as FromToNativeWasmType>::Native) -> u32
fn to_native(self) -> <u32 as FromToNativeWasmType>::Native
impl FromToNativeWasmType for i32
type Native = i32
fn from_native(native: <i32 as FromToNativeWasmType>::Native) -> i32
fn to_native(self) -> <i32 as FromToNativeWasmType>::Native
impl FromToNativeWasmType for i64
type Native = i64
fn from_native(native: <i64 as FromToNativeWasmType>::Native) -> i64
fn to_native(self) -> <i64 as FromToNativeWasmType>::Native
Implementors
impl<T, Ty> FromToNativeWasmType for WasmPtr<T, Ty> where
T: Copy,
T: Copy,
type Native = i32
fn to_native(self) -> <WasmPtr<T, Ty> as FromToNativeWasmType>::Native
fn from_native(
n: <WasmPtr<T, Ty> as FromToNativeWasmType>::Native
) -> WasmPtr<T, Ty>
n: <WasmPtr<T, Ty> as FromToNativeWasmType>::Native
) -> WasmPtr<T, Ty>