WasmFunc

Trait WasmFunc 

pub trait WasmFunc {
    type Type: WasmType;

    // Required methods
    fn params(&self) -> Box<dyn Iterator<Item = Self::Type> + '_>;
    fn results(&self) -> Box<dyn Iterator<Item = Self::Type> + '_>;

    // Provided methods
    fn param_names(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_> { ... }
    fn result_names(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_> { ... }
}
Expand description

The WasmFunc trait may be implemented to represent Wasm func type signatures to be (de)serialized with WAVE.

Required Associated Types§

type Type: WasmType

A type representing types of these params and results.

Required Methods§

fn params(&self) -> Box<dyn Iterator<Item = Self::Type> + '_>

Returns an iterator of the func’s parameter types.

fn results(&self) -> Box<dyn Iterator<Item = Self::Type> + '_>

Returns an iterator of the func’s result types.

Provided Methods§

fn param_names(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_>

Returns an iterator of the func’s parameter names. Must be the same length as the iterator returned by params or empty if this WasmFunc impl does not support param names.

fn result_names(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_>

Returns an iterator of the func’s result names. Must be the same length as the iterator returned by results or empty if there are no named results or if this WasmFunc impl does not support result names.

Implementors§

Source§

impl WasmFunc for wiggle::wasmtime_crate::FuncType

Source§

impl WasmFunc for ComponentFunc

§

impl WasmFunc for wiggle::wasmtime_crate::component::wasm_wave::value::FuncType

§

type Type = Type