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§
Required Methods§
Provided Methods§
fn param_names(&self) -> Box<dyn Iterator<Item = Cow<'_, str>> + '_>
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>> + '_>
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.