referrerpolicy=no-referrer-when-downgrade
sp_runtime_interface::host

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

Source§

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

Source§

impl IntoFFIValue for i8

Source§

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

Source§

impl IntoFFIValue for i16

Source§

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

Source§

impl IntoFFIValue for i32

Source§

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

Source§

impl IntoFFIValue for i64

Source§

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

Source§

impl IntoFFIValue for u8

Source§

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

Source§

impl IntoFFIValue for u16

Source§

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

Source§

impl IntoFFIValue for u32

Source§

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

Source§

impl IntoFFIValue for u64

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]>,

Source§

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

Source§

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

Source§

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

Source§

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