referrerpolicy=no-referrer-when-downgrade
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>, String>;
}
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>, String>

Execute this function with the given arguments.

Trait Implementations§

Source§

impl PartialEq for dyn Function

Source§

fn eq(&self, other: &(dyn Function + 'static)) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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.

Implementors§