Skip to main content

SQLScalarFunction

Trait SQLScalarFunction 

Source
pub trait SQLScalarFunction: Send + Sync {
    // Provided methods
    fn call(&self, _args: &[Value]) -> Result<Value, SQLError> { ... }
    fn call_with_context(
        &self,
        _context: &SQLFunctionContext,
        args: &[Value],
    ) -> Result<Value, SQLError> { ... }
}
Expand description

Rust implementation of a scalar SQL function.

Provided Methods§

Source

fn call(&self, _args: &[Value]) -> Result<Value, SQLError>

Source

fn call_with_context( &self, _context: &SQLFunctionContext, args: &[Value], ) -> Result<Value, SQLError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F> SQLScalarFunction for F
where F: Fn(&[Value]) -> Result<Value, SQLError> + Send + Sync,