Trait sp_runtime_interface::pass_by::PassByImpl [−][src]
pub trait PassByImpl<T>: RIType { fn into_ffi_value(
instance: T,
context: &mut dyn FunctionContext
) -> Result<Self::FFIType>; fn from_ffi_value(
context: &mut dyn FunctionContext,
arg: Self::FFIType
) -> Result<T>; }
Expand description
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>
fn into_ffi_value(
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>
fn from_ffi_value(
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>,