pub struct BuiltinRegistry { /* private fields */ }Expand description
Registry of built-in functions
This struct manages all built-in functions and provides a unified interface for calling them during filter execution.
Implementations§
Source§impl BuiltinRegistry
impl BuiltinRegistry
Sourcepub fn new() -> BuiltinRegistry
pub fn new() -> BuiltinRegistry
Create a new builtin registry with standard functions
Sourcepub fn register(
&mut self,
name: impl Into<String>,
func: Arc<dyn Fn(&[Value]) -> Result<Value, Error> + Sync + Send>,
)
pub fn register( &mut self, name: impl Into<String>, func: Arc<dyn Fn(&[Value]) -> Result<Value, Error> + Sync + Send>, )
Register a built-in function
Sourcepub fn has_function(&self, name: &str) -> bool
pub fn has_function(&self, name: &str) -> bool
Check if a function exists
Sourcepub fn call_function(&self, name: &str, args: &[Value]) -> Result<Value, Error>
pub fn call_function(&self, name: &str, args: &[Value]) -> Result<Value, Error>
Call a built-in function
Sourcepub fn function_count(&self) -> usize
pub fn function_count(&self) -> usize
Get the number of registered functions
Sourcepub fn get_function(
&self,
name: &str,
) -> Option<Arc<dyn Fn(&[Value]) -> Result<Value, Error> + Sync + Send>>
pub fn get_function( &self, name: &str, ) -> Option<Arc<dyn Fn(&[Value]) -> Result<Value, Error> + Sync + Send>>
Get a built-in function by name
Sourcepub fn function_names(&self) -> Vec<String>
pub fn function_names(&self) -> Vec<String>
Get all function names
Trait Implementations§
Source§impl Debug for BuiltinRegistry
impl Debug for BuiltinRegistry
Source§impl Default for BuiltinRegistry
impl Default for BuiltinRegistry
Source§fn default() -> BuiltinRegistry
fn default() -> BuiltinRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BuiltinRegistry
impl !RefUnwindSafe for BuiltinRegistry
impl Send for BuiltinRegistry
impl Sync for BuiltinRegistry
impl Unpin for BuiltinRegistry
impl !UnwindSafe for BuiltinRegistry
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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