Struct mage::Function
[−]
pub struct Function { pub max_args: Option<usize>, pub min_args: Option<usize>, pub compiled: Box<Fn(Vec<Value>) + 'static + Send + Sync>, }
Custom function
Fields
max_args: Option<usize>
Maximum number of arguments.
min_args: Option<usize>
Minimum number of arguments.
compiled: Box<Fn(Vec<Value>) + 'static + Send + Sync>
Accept values and return a result which contains a value.
Methods
impl Function
fn new<F>(closure: F) -> Function where F: 'static + Fn(Vec<Value>) -> Result<Value, Error> + Sync + Send
Create a function with a closure.