[][src]Trait wasmer::FromToNativeWasmType

pub unsafe trait FromToNativeWasmType: Copy where
    Self: Sized
{ type Native: NativeWasmType; pub fn from_native(native: Self::Native) -> Self;
pub fn to_native(self) -> Self::Native; }

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]

Native Wasm type.

Loading content...

Required methods

pub 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`.

pub fn to_native(self) -> Self::Native[src]

Convert self to Self::Native.

Panics

This method panics if self cannot fit in the Self::Native type.

Loading content...

Implementations on Foreign Types

impl FromToNativeWasmType for i8[src]

type Native = i32

impl FromToNativeWasmType for u8[src]

type Native = i32

impl FromToNativeWasmType for i16[src]

type Native = i32

impl FromToNativeWasmType for u16[src]

type Native = i32

impl FromToNativeWasmType for i32[src]

type Native = i32

impl FromToNativeWasmType for u32[src]

type Native = i32

impl FromToNativeWasmType for i64[src]

type Native = i64

impl FromToNativeWasmType for u64[src]

type Native = i64

impl FromToNativeWasmType for f32[src]

type Native = f32

impl FromToNativeWasmType for f64[src]

type Native = f64

Loading content...

Implementors

impl<T: Copy, Ty> FromToNativeWasmType for WasmPtr<T, Ty>[src]

type Native = i32

Loading content...