Skip to main content

FunctionData

Trait FunctionData 

Source
pub trait FunctionData {
    // Required methods
    fn name(&self) -> &str;
    fn return_kind(&self) -> ReturnKind;
    fn is_method(&self) -> bool;
}
Expand description

Metadata about a function declared by an interface.

Provides information needed during linking to wire up cross-plugin dispatch. Each function in an interface needs metadata so wasm_link knows how to handle calls across plugin boundaries.

Required Methods§

Source

fn name(&self) -> &str

Returns the function’s name as defined per the WebAssembly component model specifications and WIT standards (e.g. get-value, [constructor]counter, [method]counter.increment).

Source

fn return_kind(&self) -> ReturnKind

Returns the function’s return kind. wasm_link may do some mapping on the returned value. This can be used to tell it to skip certain steps as it is known ahead of the time that they are not needed.

Source

fn is_method(&self) -> bool

Returns true if this is a method (has a self parameter). This changes the behaviour of calling into a non-ExactlyOne cardinality to only call into the plugin that created the resource given to this method

Implementors§