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

Something that can be used by the runtime interface as type to communicate between wasm 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 ffi type that is used to represent Self.

Implementations on Foreign Types§

source§

impl RIType for [u8; 17]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 15]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for bool

bool is passed as u32.

  • 1: true
  • 0: false
§

type FFIType = u32

source§

impl RIType for [u8; 75]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 30]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for u64

The type is passed directly.

§

type FFIType = u64

source§

impl RIType for i64

The type is passed directly.

§

type FFIType = i64

source§

impl RIType for [u8; 74]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 76]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 96]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 2]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 61]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 63]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 43]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 16]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 48]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 20]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 21]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 79]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 95]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 51]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for u16

The type is passed directly.

§

type FFIType = u32

source§

impl RIType for [u8; 72]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 8]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 94]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 60]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 31]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for u8

The type is passed directly.

§

type FFIType = u32

source§

impl RIType for [u8; 36]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 55]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 40]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 58]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 73]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 90]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 47]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 14]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 33]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 18]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 50]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 49]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 89]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 22]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 67]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 29]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for u128

u128/i128 is passed as u32.

The u32 is a pointer to an [u8; 16] array.

§

type FFIType = u32

source§

impl RIType for [u8; 25]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 45]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 11]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 84]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 10]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 19]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for i16

The type is passed directly.

§

type FFIType = i32

source§

impl RIType for [u8; 34]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 69]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 5]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 37]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 68]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 52]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 57]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl<T> RIType for Vec<T>

The type is passed as u64.

The u64 value is build by length 32bit << 32 | pointer 32bit

If T == u8 the length and the pointer are taken directly from Self. Otherwise Self is encoded and the length and the pointer are taken from the encoded vector.

§

type FFIType = u64

source§

impl RIType for [u8; 83]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 3]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 62]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for u32

The type is passed directly.

§

type FFIType = u32

source§

impl RIType for [u8; 26]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 28]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 38]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 70]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for i128

u128/i128 is passed as u32.

The u32 is a pointer to an [u8; 16] array.

§

type FFIType = u32

source§

impl RIType for [u8; 65]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 24]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 39]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 9]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 87]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 42]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 78]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 12]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 41]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 56]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 86]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 71]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 81]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 35]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 27]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for str

The type is passed as u64.

The u64 value is build by length 32bit << 32 | pointer 32bit

The length and the pointer are taken directly from Self.

§

type FFIType = u64

source§

impl RIType for [u8; 85]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for i8

The type is passed directly.

§

type FFIType = i32

source§

impl RIType for [u8; 54]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 64]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl<T> RIType for [T]

The type is passed as u64.

The u64 value is build by length 32bit << 32 | pointer 32bit

If T == u8 the length and the pointer are taken directly from Self. Otherwise Self is encoded and the length and the pointer are taken from the encoded vector.

§

type FFIType = u64

source§

impl RIType for [u8; 6]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 59]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 4]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 23]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 53]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 66]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 93]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 88]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 92]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 91]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 1]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 7]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 77]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 46]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 80]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 44]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 82]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 32]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for [u8; 13]

The type is passed as u32.

The u32 is the pointer to the array.

§

type FFIType = u32

source§

impl RIType for i32

The type is passed directly.

§

type FFIType = i32

Implementors§

source§

impl<T: Codec> RIType for Codec<T>

The type is passed as u64.

The u64 value is build by length 32bit << 32 | pointer 32bit

Self is encoded and the length and the pointer are taken from the encoded vector.

§

type FFIType = u64

source§

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

§

type FFIType = u32

source§

impl<T: Copy + Into<u8> + TryFrom<u8>> RIType for Enum<T>

The type is passed as u32.

The value is corresponds to the discriminant of the variant.

§

type FFIType = u32

source§

impl<T: PassBy> RIType for T

§

type FFIType = <<T as PassBy>::PassBy as RIType>::FFIType

source§

impl<T: PassByInner<Inner = I>, I: RIType> RIType for Inner<T, I>

The type is passed as the inner type.

§

type FFIType = <I as RIType>::FFIType