Skip to main content

Function

Trait Function 

Source
pub trait Function:
    MaybeRefUnwindSafe
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn signature(&self) -> Signature;
    fn execute(
        &self,
        context: &mut dyn FunctionContext,
        args: &mut dyn Iterator<Item = Value>,
    ) -> Result<Option<Value>>;
}
Expand description

Something that provides a function implementation on the host for a wasm function.

Required Methods§

Source

fn name(&self) -> &str

Returns the name of this function.

Source

fn signature(&self) -> Signature

Returns the signature of this function.

Source

fn execute( &self, context: &mut dyn FunctionContext, args: &mut dyn Iterator<Item = Value>, ) -> Result<Option<Value>>

Execute this function with the given arguments.

Trait Implementations§

Source§

impl PartialEq for dyn Function

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§