logo
pub trait WasmTypeList where
    Self: Sized
{ type CStruct; type Array: AsMut<[RawValue]>; unsafe fn from_array(store: &mut impl AsStoreMut, array: Self::Array) -> Self; unsafe fn from_slice(
        store: &mut impl AsStoreMut,
        slice: &[RawValue]
    ) -> Result<Self, TryFromSliceError>; unsafe fn into_array(self, store: &mut impl AsStoreMut) -> Self::Array; fn empty_array() -> Self::Array; unsafe fn from_c_struct(
        store: &mut impl AsStoreMut,
        c_struct: Self::CStruct
    ) -> Self; unsafe fn into_c_struct(self, store: &mut impl AsStoreMut) -> Self::CStruct; unsafe fn write_c_struct_to_ptr(c_struct: Self::CStruct, ptr: *mut RawValue); fn wasm_types() -> &'static [Type]; }
Expand description

The WasmTypeList trait represents a tuple (list) of Wasm typed values. It is used to get low-level representation of such a tuple.

Required Associated Types

The C type (a struct) that can hold/represent all the represented values.

The array type that can hold all the represented values.

Note that all values are stored in their binary form.

Required Methods

Constructs Self based on an array of values.

Safety

Constructs Self based on a slice of values.

from_slice returns a Result because it is possible that the slice doesn’t have the same size than Self::Array, in which circumstance an error of kind TryFromSliceError will be returned.

Safety

Builds and returns an array of type Array from a tuple (list) of values.

Safety

Allocates and return an empty array of type Array that will hold a tuple (list) of values, usually to hold the returned values of a WebAssembly function call.

Builds a tuple (list) of values from a C struct of type CStruct.

Safety

Builds and returns a C struct of type CStruct from a tuple (list) of values.

Safety

Writes the contents of a C struct to an array of RawValue.

Safety

Get the Wasm types for the tuple (list) of currently represented values.

Implementations on Foreign Types

Implementors