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.
Trait Implementations§
Source§impl Default for FunctionRegistry
impl Default for FunctionRegistry
Source§fn default() -> FunctionRegistry
fn default() -> FunctionRegistry
Returns the “default value” for a type. Read more
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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