Trait wasmer::FromToNativeWasmType [−][src]
pub unsafe trait FromToNativeWasmType where
Self: Sized, { type Native: NativeWasmType; fn from_native(native: Self::Native) -> Self; fn to_native(self) -> Self::Native; }
Expand description
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 split into two traits:
FromNativeWasmType
and ToNativeWasmType
but it creates a
non-negligible complexity in the WasmTypeList
implementation.
Associated Types
type Native: NativeWasmType
[src]
type Native: NativeWasmType
[src]Native Wasm type.
Required methods
fn from_native(native: Self::Native) -> Self
[src]
fn from_native(native: Self::Native) -> Self
[src]Convert a value of kind Self::Native
to Self
.
Panics
This method panics if native
cannot fit in the Self
type`.