IntoFFIValue

Trait IntoFFIValue 

Source
pub trait IntoFFIValue: RIType {
    // Required method
    fn into_ffi_value(
        value: Self::Inner,
        context: &mut dyn FunctionContext,
    ) -> Result<Self::FFIType>;
}
Expand description

A type used as a return value in a host function. Can be turned into an FFI value.

Required Methods§

Source

fn into_ffi_value( value: Self::Inner, context: &mut dyn FunctionContext, ) -> Result<Self::FFIType>

Convert Self::Inner into an FFI value.

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 IntoFFIValue for bool

Available on non-substrate_runtime only.
Source§

fn into_ffi_value(value: Self, _: &mut dyn FunctionContext) -> Result<u32>

Source§

impl IntoFFIValue for i8

Available on non-substrate_runtime only.
Source§

fn into_ffi_value( value: Self::Inner, _: &mut dyn FunctionContext, ) -> Result<i32>

Source§

impl IntoFFIValue for i16

Available on non-substrate_runtime only.
Source§

fn into_ffi_value( value: Self::Inner, _: &mut dyn FunctionContext, ) -> Result<i32>

Source§

impl IntoFFIValue for i32

Available on non-substrate_runtime only.
Source§

fn into_ffi_value( value: Self::Inner, _: &mut dyn FunctionContext, ) -> Result<i32>

Source§

impl IntoFFIValue for i64

Available on non-substrate_runtime only.
Source§

fn into_ffi_value( value: Self::Inner, _: &mut dyn FunctionContext, ) -> Result<i64>

Source§

impl IntoFFIValue for u8

Available on non-substrate_runtime only.
Source§

fn into_ffi_value( value: Self::Inner, _: &mut dyn FunctionContext, ) -> Result<u32>

Source§

impl IntoFFIValue for u16

Available on non-substrate_runtime only.
Source§

fn into_ffi_value( value: Self::Inner, _: &mut dyn FunctionContext, ) -> Result<u32>

Source§

impl IntoFFIValue for u32

Available on non-substrate_runtime only.
Source§

fn into_ffi_value( value: Self::Inner, _: &mut dyn FunctionContext, ) -> Result<u32>

Source§

impl IntoFFIValue for u64

Available on non-substrate_runtime only.
Source§

fn into_ffi_value( value: Self::Inner, _: &mut dyn FunctionContext, ) -> Result<u64>

Implementors§

Source§

impl<T> IntoFFIValue for AllocateAndReturnFatPointer<T>
where T: AsRef<[u8]>,

Available on non-substrate_runtime only.
Source§

impl<T, U> IntoFFIValue for ReturnAs<T, U>
where U: RIType + IntoFFIValue + Primitive, <U as RIType>::Inner: From<Self::Inner>,

Available on non-substrate_runtime only.
Source§

impl<T, const N: usize> IntoFFIValue for AllocateAndReturnPointer<T, N>
where T: AsRef<[u8]>,

Available on non-substrate_runtime only.
Source§

impl<T: Encode> IntoFFIValue for AllocateAndReturnByCodec<T>

Available on non-substrate_runtime only.
Source§

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

Available on non-substrate_runtime only.