referrerpolicy=no-referrer-when-downgrade
sp_runtime_interface

Trait RIType

Source
pub trait RIType: Sized {
    type FFIType: IntoValue + TryFromValue + WasmTy;
    type Inner;
}
Expand description

Something that can be used by the runtime interface as type to communicate between the runtime and the host.

Every type that should be used in a runtime interface function signature needs to implement this trait.

Required Associated Types§

Source

type FFIType: IntoValue + TryFromValue + WasmTy

The raw FFI type that is used to pass Self through the host <-> runtime boundary.

Source

type Inner

The inner type without any serialization strategy wrapper.

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

bool is passed as u32.

  • 1: true
  • 0: false
Source§

impl RIType for i8

The type is passed directly.

Source§

impl RIType for i16

The type is passed directly.

Source§

impl RIType for i32

The type is passed directly.

Source§

impl RIType for i64

The type is passed directly.

Source§

impl RIType for u8

The type is passed directly.

Source§

impl RIType for u16

The type is passed directly.

Source§

impl RIType for u32

The type is passed directly.

Source§

impl RIType for u64

The type is passed directly.

Implementors§