linkrs_query/executor/expression/functions/registry/
custom.rs1use super::super::CustomFunction;
2use super::FunctionRegistry;
3
4impl FunctionRegistry {
5 pub fn register_custom_full(&mut self, function: CustomFunction) {
7 let upper_name = function.name.to_uppercase();
8 self.custom_functions.insert(upper_name, function);
9 }
10
11 pub fn unregister_custom(&mut self, name: &str) -> bool {
17 let upper = name.to_uppercase();
18 if self.dynamic_libraries.contains_key(&upper)
19 || self.builtin_functions.contains_key(&upper)
20 {
21 return false;
22 }
23 self.custom_functions.remove(&upper).is_some()
24 }
25 pub fn get_custom(&self, name: &str) -> Option<&CustomFunction> {
27 let upper_name = name.to_uppercase();
29 self.custom_functions.get(&upper_name)
30 }
31}