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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromFFIValue for bool

§

type SelfInstance = bool

source§

fn from_ffi_value(_: &mut dyn FunctionContext, arg: u32) -> Result<bool>

source§

impl FromFFIValue for i8

§

type SelfInstance = i8

source§

fn from_ffi_value(_: &mut dyn FunctionContext, arg: i32) -> Result<i8>

source§

impl FromFFIValue for i16

§

type SelfInstance = i16

source§

fn from_ffi_value(_: &mut dyn FunctionContext, arg: i32) -> Result<i16>

source§

impl FromFFIValue for i32

§

type SelfInstance = i32

source§

fn from_ffi_value(_: &mut dyn FunctionContext, arg: i32) -> Result<i32>

source§

impl FromFFIValue for i64

§

type SelfInstance = i64

source§

fn from_ffi_value(_: &mut dyn FunctionContext, arg: i64) -> Result<i64>

source§

impl FromFFIValue for i128

§

type SelfInstance = i128

source§

fn from_ffi_value(context: &mut dyn FunctionContext, arg: u32) -> Result<i128>

source§

impl FromFFIValue for str

§

type SelfInstance = String

source§

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

source§

impl FromFFIValue for u8

§

type SelfInstance = u8

source§

fn from_ffi_value(_: &mut dyn FunctionContext, arg: u32) -> Result<u8>

source§

impl FromFFIValue for u16

§

type SelfInstance = u16

source§

fn from_ffi_value(_: &mut dyn FunctionContext, arg: u32) -> Result<u16>

source§

impl FromFFIValue for u32

§

type SelfInstance = u32

source§

fn from_ffi_value(_: &mut dyn FunctionContext, arg: u32) -> Result<u32>

source§

impl FromFFIValue for u64

§

type SelfInstance = u64

source§

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

source§

impl FromFFIValue for u128

§

type SelfInstance = u128

source§

fn from_ffi_value(context: &mut dyn FunctionContext, arg: u32) -> Result<u128>

source§

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

§

type SelfInstance = Vec<T>

source§

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

source§

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

§

type SelfInstance = Vec<T>

source§

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

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]>

Implementors§

source§

impl<T: PassBy> FromFFIValue for T

source§

impl<T: PointerType> FromFFIValue for Pointer<T>

§

type SelfInstance = Pointer<T>