Skip to main content

Method

Trait Method 

Source
pub trait Method: Send + Sync {
    // Required method
    fn call(&self, recv: Val, args: &[Val]) -> Result<Val, EvalError>;
}
Expand description

A custom method that can be registered with MethodRegistry.

recv — the value the method was called on args — positional arguments, already evaluated to Val

Required Methods§

Source

fn call(&self, recv: Val, args: &[Val]) -> Result<Val, EvalError>

Implementors§

Source§

impl<F> Method for F
where F: Fn(Val, &[Val]) -> Result<Val, EvalError> + Send + Sync,

Blanket impl: any Fn(Val, &[Val]) -> Result<Val, EvalError> is a Method.