pub struct WirerustEngine { /* private fields */ }Expand description
The main engine for parsing, compiling, and executing filters.
Implementations§
Source§impl WirerustEngine
impl WirerustEngine
Sourcepub fn new(schema: FilterSchema) -> Self
pub fn new(schema: FilterSchema) -> Self
Create a new engine with the given schema and built-in functions.
Sourcepub fn with_functions(schema: FilterSchema, functions: FunctionRegistry) -> Self
pub fn with_functions(schema: FilterSchema, functions: FunctionRegistry) -> Self
Create a new engine with the given schema and custom function registry.
Sourcepub fn schema(&self) -> &FilterSchema
pub fn schema(&self) -> &FilterSchema
Get a reference to the filter schema.
Sourcepub fn functions(&self) -> &FunctionRegistry
pub fn functions(&self) -> &FunctionRegistry
Get a reference to the function registry.
Sourcepub fn parse_filter(&self, expr: &str) -> Result<FilterExpr, WirerustError>
pub fn parse_filter(&self, expr: &str) -> Result<FilterExpr, WirerustError>
Parse a filter expression string into an AST.
Sourcepub fn compile_filter(
&self,
expr: FilterExpr,
) -> Result<CompiledFilter, WirerustError>
pub fn compile_filter( &self, expr: FilterExpr, ) -> Result<CompiledFilter, WirerustError>
Compile a parsed filter expression into an executable filter.
Sourcepub fn parse_and_compile(
&self,
expr: &str,
) -> Result<CompiledFilter, WirerustError>
pub fn parse_and_compile( &self, expr: &str, ) -> Result<CompiledFilter, WirerustError>
Parse and compile a filter expression string in one step.
Sourcepub fn execute(
&self,
filter: &CompiledFilter,
ctx: &FilterContext,
) -> Result<bool, WirerustError>
pub fn execute( &self, filter: &CompiledFilter, ctx: &FilterContext, ) -> Result<bool, WirerustError>
Execute a compiled filter against a context.
Auto Trait Implementations§
impl Freeze for WirerustEngine
impl !RefUnwindSafe for WirerustEngine
impl Send for WirerustEngine
impl Sync for WirerustEngine
impl Unpin for WirerustEngine
impl !UnwindSafe for WirerustEngine
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