pub struct FilterContext { /* private fields */ }Expand description
Execution context for filter operations
Implementations§
Source§impl FilterContext
impl FilterContext
Sourcepub fn set_variable(&mut self, name: impl Into<String>, value: Value)
pub fn set_variable(&mut self, name: impl Into<String>, value: Value)
Set a variable binding
Sourcepub fn set_functions(&mut self, functions: HashMap<String, FunctionDef>)
pub fn set_functions(&mut self, functions: HashMap<String, FunctionDef>)
Set user-defined functions
Sourcepub fn get_variable(&self, name: &str) -> Option<&Value>
pub fn get_variable(&self, name: &str) -> Option<&Value>
Get a variable value
Sourcepub fn has_variable(&self, name: &str) -> bool
pub fn has_variable(&self, name: &str) -> bool
Check if a variable exists
Sourcepub fn has_function(&self, name: &str) -> bool
pub fn has_function(&self, name: &str) -> bool
Check if a function is defined
Sourcepub fn call_function(&mut self, name: &str, args: &[Value]) -> Result<Value>
pub fn call_function(&mut self, name: &str, args: &[Value]) -> Result<Value>
Call a function with arguments
Sourcepub fn recursion_depth(&self) -> usize
pub fn recursion_depth(&self) -> usize
Get the current recursion depth
Sourcepub fn set_debug_mode(&mut self, debug: bool)
pub fn set_debug_mode(&mut self, debug: bool)
Enable or disable debug mode
Sourcepub fn is_debug_mode(&self) -> bool
pub fn is_debug_mode(&self) -> bool
Check if debug mode is enabled
Sourcepub fn set_error_mode(&mut self, mode: ErrorMode)
pub fn set_error_mode(&mut self, mode: ErrorMode)
Set error handling mode
Sourcepub fn error_mode(&self) -> ErrorMode
pub fn error_mode(&self) -> ErrorMode
Get current error handling mode
Trait Implementations§
Source§impl Clone for FilterContext
impl Clone for FilterContext
Source§fn clone(&self) -> FilterContext
fn clone(&self) -> FilterContext
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Context for FilterContext
impl Context for FilterContext
Source§fn set_variable(&mut self, name: &str, value: Value)
fn set_variable(&mut self, name: &str, value: Value)
Set a variable value
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Downcast mutably
Source§impl Debug for FilterContext
impl Debug for FilterContext
Auto Trait Implementations§
impl !Freeze for FilterContext
impl !RefUnwindSafe for FilterContext
impl Send for FilterContext
impl Sync for FilterContext
impl Unpin for FilterContext
impl !UnwindSafe for FilterContext
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
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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