FromFFIValue

Trait FromFFIValue 

Source
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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromFFIValue for bool

Available on crate feature std only.
Source§

impl FromFFIValue for i8

Available on crate feature std only.
Source§

impl FromFFIValue for i16

Available on crate feature std only.
Source§

impl FromFFIValue for i32

Available on crate feature std only.
Source§

impl FromFFIValue for i64

Available on crate feature std only.
Source§

impl FromFFIValue for i128

Available on crate feature std only.
Source§

impl FromFFIValue for str

Available on crate feature std only.
Source§

impl FromFFIValue for u8

Available on crate feature std only.
Source§

impl FromFFIValue for u16

Available on crate feature std only.
Source§

impl FromFFIValue for u32

Available on crate feature std only.
Source§

impl FromFFIValue for u64

Available on crate feature std only.
Source§

impl FromFFIValue for u128

Available on crate feature std only.
Source§

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

Available on crate feature std only.
Source§

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>

Available on crate feature std only.
Source§

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]

Available on crate feature std only.
Source§

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

Available on crate feature std only.
Source§

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

Available on crate feature std only.