use super::super::CustomFunction;
use super::FunctionRegistry;
impl FunctionRegistry {
pub fn register_custom_full(&mut self, function: CustomFunction) {
let upper_name = function.name.to_uppercase();
self.custom_functions.insert(upper_name, function);
}
pub fn unregister_custom(&mut self, name: &str) -> bool {
let upper = name.to_uppercase();
if self.dynamic_libraries.contains_key(&upper)
|| self.builtin_functions.contains_key(&upper)
{
return false;
}
self.custom_functions.remove(&upper).is_some()
}
pub fn get_custom(&self, name: &str) -> Option<&CustomFunction> {
let upper_name = name.to_uppercase();
self.custom_functions.get(&upper_name)
}
}