Trait meval::ArgGuard[][src]

pub trait ArgGuard {
    fn to_arg_guard<'a, F: Fn(&[f64]) -> f64 + 'a>(
        self,
        func: F
    ) -> Rc<Fn(&[f64]) -> Result<f64, FuncEvalError> + 'a>; }

Trait for types that can specify the number of required arguments for a function with a variable number of arguments.

Example

let mut ctx = meval::Context::empty();

// require exactly 2 arguments
ctx.funcn("sum_two", |xs| xs[0] + xs[1], 2);

// allow an arbitrary number of arguments
ctx.funcn("sum", |xs| xs.iter().sum(), ..);

Required Methods

Implementations on Foreign Types

impl ArgGuard for usize
[src]

impl ArgGuard for RangeFrom<usize>
[src]

impl ArgGuard for RangeTo<usize>
[src]

impl ArgGuard for Range<usize>
[src]

impl ArgGuard for RangeFull
[src]

Implementors