Skip to main content

Function

Trait Function 

Source
pub trait Function: Sync + Send {
    // Required method
    fn call(&self, args: &HashMap<String, Value>) -> Result<Value, Error>;

    // Provided method
    fn is_safe(&self) -> bool { ... }
}
Expand description

The global function type definition

Required Methods§

Source

fn call(&self, args: &HashMap<String, Value>) -> Result<Value, Error>

The global function type definition

Provided Methods§

Source

fn is_safe(&self) -> bool

Whether the current function’s output should be treated as safe, defaults to false

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> Function for F
where F: Fn(&HashMap<String, Value>) -> Result<Value, Error> + Sync + Send,