Trait sp_runtime_interface::pass_by::PassByImpl [−][src]
Something that provides a strategy for passing a type between wasm and the host.
This trait exposes the same functionality as crate::host::IntoFFIValue
and
crate::host::FromFFIValue
to delegate the implementation for a type to a different type.
This trait is used for the host implementation.
Required methods
fn into_ffi_value(
instance: T,
context: &mut dyn FunctionContext
) -> Result<Self::FFIType>
[src]
instance: T,
context: &mut dyn FunctionContext
) -> Result<Self::FFIType>
Convert the given instance to the ffi value.
For more information see: crate::host::IntoFFIValue::into_ffi_value
fn from_ffi_value(
context: &mut dyn FunctionContext,
arg: Self::FFIType
) -> Result<T>
[src]
context: &mut dyn FunctionContext,
arg: Self::FFIType
) -> Result<T>
Create T
from the given ffi value.
For more information see: crate::host::FromFFIValue::from_ffi_value
Implementors
impl<T: PassByInner<Inner = I>, I: RIType> PassByImpl<T> for Inner<T, I> where
I: IntoFFIValue + FromFFIValue<SelfInstance = I>,
[src]
I: IntoFFIValue + FromFFIValue<SelfInstance = I>,
fn into_ffi_value(
instance: T,
context: &mut dyn FunctionContext
) -> Result<Self::FFIType>
[src]
instance: T,
context: &mut dyn FunctionContext
) -> Result<Self::FFIType>
fn from_ffi_value(
context: &mut dyn FunctionContext,
arg: Self::FFIType
) -> Result<T>
[src]
context: &mut dyn FunctionContext,
arg: Self::FFIType
) -> Result<T>
impl<T: Copy + Into<u8> + TryFrom<u8>> PassByImpl<T> for Enum<T>
[src]
fn into_ffi_value(
instance: T,
_: &mut dyn FunctionContext
) -> Result<Self::FFIType>
[src]
instance: T,
_: &mut dyn FunctionContext
) -> Result<Self::FFIType>
fn from_ffi_value(_: &mut dyn FunctionContext, arg: Self::FFIType) -> Result<T>
[src]
impl<T: Codec> PassByImpl<T> for Codec<T>
[src]
fn into_ffi_value(
instance: T,
context: &mut dyn FunctionContext
) -> Result<Self::FFIType>
[src]
instance: T,
context: &mut dyn FunctionContext
) -> Result<Self::FFIType>
fn from_ffi_value(
context: &mut dyn FunctionContext,
arg: Self::FFIType
) -> Result<T>
[src]
context: &mut dyn FunctionContext,
arg: Self::FFIType
) -> Result<T>