Trait Extension

Source
pub trait Extension:
    FnMut(Vec<Value>) -> Result<Value>
    + Send
    + Sync {
    // Required method
    fn clone_box<'a>(&self) -> Box<dyn Extension + 'a>
       where Self: 'a;
}
Expand description

A user defined builtin function implementation.

It is not necessary to implement this trait directly.

Required Methods§

Source

fn clone_box<'a>(&self) -> Box<dyn Extension + 'a>
where Self: 'a,

Fn, FnMut etc are not sized and cannot be cloned in their boxed form. clone_box exists to overcome that.

Trait Implementations§

Source§

impl Clone for Box<dyn Extension + '_>

Implement clone for a boxed extension using Extension::clone_box.

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for dyn Extension

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Implementors§

Source§

impl<F> Extension for F
where F: FnMut(Vec<Value>) -> Result<Value> + Clone + Send + Sync,

Automatically make matching closures a valid Extension.