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>; }

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]

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]

Create T from the given ffi value.

For more information see: crate::host::FromFFIValue::from_ffi_value

Loading content...

Implementors

impl<T: PassByInner<Inner = I>, I: RIType> PassByImpl<T> for Inner<T, I> where
    I: IntoFFIValue + FromFFIValue<SelfInstance = I>, 
[src]

impl<T: Copy + Into<u8> + TryFrom<u8>> PassByImpl<T> for Enum<T>[src]

impl<T: Codec> PassByImpl<T> for Codec<T>[src]

Loading content...