polars_sql::function_registry

Trait FunctionRegistry

Source
pub trait FunctionRegistry: Send + Sync {
    // Required methods
    fn register(
        &mut self,
        name: &str,
        fun: UserDefinedFunction,
    ) -> PolarsResult<()>;
    fn get_udf(&self, name: &str) -> PolarsResult<Option<UserDefinedFunction>>;
    fn contains(&self, name: &str) -> bool;
}
Expand description

A registry that holds user defined functions.

Required Methods§

Source

fn register(&mut self, name: &str, fun: UserDefinedFunction) -> PolarsResult<()>

Register a function.

Source

fn get_udf(&self, name: &str) -> PolarsResult<Option<UserDefinedFunction>>

Call a user defined function.

Source

fn contains(&self, name: &str) -> bool

Check if a function is registered.

Implementors§