pub trait NativeFunc: Send + Sync + 'static {
    // Required method
    fn invoke<'v>(
        &self,
        eval: &mut Evaluator<'v, '_>,
        args: &Arguments<'v, '_>
    ) -> Result<Value<'v>>;
}
Expand description

A native function that can be evaluated.

This trait is implemented by generated code and rarely needed to be implemented manually.

Required Methods§

source

fn invoke<'v>( &self, eval: &mut Evaluator<'v, '_>, args: &Arguments<'v, '_> ) -> Result<Value<'v>>

Invoke the function.

Implementors§

source§

impl<T> NativeFunc for T
where T: for<'v> Fn(&mut Evaluator<'v, '_>, &Arguments<'v, '_>) -> Result<Value<'v>> + Send + Sync + 'static,