pub struct Function {
    pub max_args: Option<usize>,
    pub min_args: Option<usize>,
    pub compiled: Box<dyn Fn(Vec<Value>) -> Result<Value, Error> + Sync + Send>,
}
Expand description

Custom function

Fields

max_args: Option<usize>

Maximum number of arguments.

min_args: Option<usize>

Minimum number of arguments.

compiled: Box<dyn Fn(Vec<Value>) -> Result<Value, Error> + Sync + Send>

Accept values and return a result which contains a value.

Implementations

Create a function with a closure.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.