pub trait FromFFIValue: RIType {
    type SelfInstance;

    // Required method
    fn from_ffi_value(
        context: &mut dyn FunctionContext,
        arg: Self::FFIType
    ) -> Result<Self::SelfInstance>;
}
Expand description

Something that can be created from a ffi value. Implementations are safe to assume that the arg given to from_ffi_value is only generated by the corresponding wasm::IntoFFIValue implementation.

Required Associated Types§

source

type SelfInstance

As Self can be an unsized type, it needs to be represented by a sized type at the host. This SelfInstance is the sized type.

Required Methods§

source

fn from_ffi_value( context: &mut dyn FunctionContext, arg: Self::FFIType ) -> Result<Self::SelfInstance>

Create SelfInstance from the given

Implementations on Foreign Types§

source§

impl<T: 'static + Decode> FromFFIValue for [T]

§

type SelfInstance = Vec<T, Global>

source§

fn from_ffi_value(context: &mut dyn FunctionContext, arg: u64) -> Result<Vec<T>>

source§

impl FromFFIValue for i8

source§

impl<const N: usize> FromFFIValue for [u8; N]

§

type SelfInstance = [u8; N]

source§

fn from_ffi_value( context: &mut dyn FunctionContext, arg: u32 ) -> Result<[u8; N]>

source§

impl FromFFIValue for i16

source§

impl FromFFIValue for u8

source§

impl FromFFIValue for u16

source§

impl FromFFIValue for u32

source§

impl FromFFIValue for u64

source§

impl<T: 'static + Decode> FromFFIValue for Vec<T>

§

type SelfInstance = Vec<T, Global>

source§

fn from_ffi_value(context: &mut dyn FunctionContext, arg: u64) -> Result<Vec<T>>

source§

impl FromFFIValue for i64

source§

impl FromFFIValue for str

source§

impl FromFFIValue for u128

source§

impl FromFFIValue for i128

source§

impl FromFFIValue for i32

source§

impl FromFFIValue for bool

Implementors§