pub struct FunctionRegistry { /* private fields */ }Expand description
Registry of all built-in functions (scalar, aggregate, table).
Implementations§
Source§impl FunctionRegistry
impl FunctionRegistry
pub fn new() -> Self
pub fn register_scalar(&mut self, name: &str, func: ScalarFunction)
pub fn register_aggregate(&mut self, name: &str, func: AggregateFunction)
pub fn register_table(&mut self, name: &str, func: TableFunction)
pub fn resolve(&self, name: &str) -> Option<ResolvedFunction>
pub fn get_scalar(&self, name: &str) -> Option<&ScalarFunction>
pub fn get_aggregate(&self, name: &str) -> Option<&AggregateFunction>
pub fn get_table(&self, name: &str) -> Option<&TableFunction>
Sourcepub fn list_all(&self) -> Vec<(String, String)>
pub fn list_all(&self) -> Vec<(String, String)>
List all registered functions as (name, kind) pairs. Kind is one of: “SCALAR”, “AGGREGATE”, “TABLE”.
pub fn contains(&self, name: &str) -> bool
Sourcepub fn scalar_count(&self) -> usize
pub fn scalar_count(&self) -> usize
Number of registered scalar functions.
Sourcepub fn aggregate_count(&self) -> usize
pub fn aggregate_count(&self) -> usize
Number of registered aggregate functions.
Sourcepub fn table_count(&self) -> usize
pub fn table_count(&self) -> usize
Number of registered table functions.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Total number of registered functions.
Sourcepub fn execute_table_function(
&self,
name: &str,
args: &[Value],
graph: Option<&dyn GraphDataSource>,
) -> Result<Vec<Vec<Value>>, String>
pub fn execute_table_function( &self, name: &str, args: &[Value], graph: Option<&dyn GraphDataSource>, ) -> Result<Vec<Vec<Value>>, String>
Execute a table function by name with the given pre-evaluated arguments.
Returns a Vec<Vec<Value>> representing rows of results.
Each inner vec is one row with one or more column values.
graph is an optional graph data source passed to graph-algorithm
table functions. Callers that own a storage catalog (e.g. the query
processor or the connection layer) supply it so GDS functions run
against real node/rel tables; callers without catalog access pass
None, in which case the closure may fall back to its built-in data.
Trait Implementations§
Source§impl Default for FunctionRegistry
impl Default for FunctionRegistry
Source§fn default() -> FunctionRegistry
fn default() -> FunctionRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for FunctionRegistry
impl !UnwindSafe for FunctionRegistry
impl Freeze for FunctionRegistry
impl Send for FunctionRegistry
impl Sync for FunctionRegistry
impl Unpin for FunctionRegistry
impl UnsafeUnpin for FunctionRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more