pub struct ExprVM { /* private fields */ }Implementations§
Source§impl ExprVM
impl ExprVM
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new VM with default stack capacity Uses inline storage for up to 16 stack values and 8 args (no heap allocation)
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a VM with specific stack capacity If capacity > 16, will spill to heap when needed
Sourcepub fn execute(
&mut self,
program: &Program,
ctx: &ExecuteContext<'_>,
) -> Result<Value>
pub fn execute( &mut self, program: &Program, ctx: &ExecuteContext<'_>, ) -> Result<Value>
Execute a program and return the result
Sourcepub fn execute_cow<'a>(
&mut self,
program: &'a Program,
ctx: &'a ExecuteContext<'a>,
) -> Result<Value>
pub fn execute_cow<'a>( &mut self, program: &'a Program, ctx: &'a ExecuteContext<'a>, ) -> Result<Value>
Execute a program using borrowed values where possible (Cow-based stack)
This version avoids cloning values from the row when possible. Values are only cloned when they need to be modified or passed to functions.
Sourcepub fn execute_bool(
&mut self,
program: &Program,
ctx: &ExecuteContext<'_>,
) -> Result<bool>
pub fn execute_bool( &mut self, program: &Program, ctx: &ExecuteContext<'_>, ) -> Result<bool>
Execute and return boolean result (for WHERE clauses)
This method is optimized for common filter patterns, avoiding the full VM loop overhead for simple comparisons.
Sourcepub fn execute_bool_checked(
&mut self,
program: &Program,
ctx: &ExecuteContext<'_>,
) -> Result<bool>
pub fn execute_bool_checked( &mut self, program: &Program, ctx: &ExecuteContext<'_>, ) -> Result<bool>
Like execute_bool but returns errors instead of swallowing them.
Used by RowFilter::matches_checked to propagate VM errors (e.g. invalid REGEXP patterns) through the query result iterator.