pub struct DebuggableRuleEngine {
pub engine: RuleEngine,
pub debug_session: DebugSession,
pub debug_enabled: bool,
}Expand description
Enhanced rule engine with debugging capabilities
Fields§
§engine: RuleEngine§debug_session: DebugSession§debug_enabled: boolImplementations§
Source§impl DebuggableRuleEngine
impl DebuggableRuleEngine
Sourcepub fn enable_debugging(&mut self, step_mode: bool)
pub fn enable_debugging(&mut self, step_mode: bool)
Enable debugging with optional configuration
Sourcepub fn disable_debugging(&mut self)
pub fn disable_debugging(&mut self)
Disable debugging
Sourcepub fn add_breakpoint(&mut self, rule_name: &str)
pub fn add_breakpoint(&mut self, rule_name: &str)
Add a breakpoint on a specific rule
Sourcepub fn remove_breakpoint(&mut self, rule_name: &str)
pub fn remove_breakpoint(&mut self, rule_name: &str)
Remove a breakpoint
Sourcepub fn debug_forward_chain(
&mut self,
facts: &[RuleAtom],
) -> Result<Vec<RuleAtom>>
pub fn debug_forward_chain( &mut self, facts: &[RuleAtom], ) -> Result<Vec<RuleAtom>>
Execute forward chaining with debugging
Sourcepub fn debug_backward_chain(&mut self, goal: &RuleAtom) -> Result<bool>
pub fn debug_backward_chain(&mut self, goal: &RuleAtom) -> Result<bool>
Execute backward chaining with debugging
Sourcepub fn get_trace(&self) -> &[TraceEntry]
pub fn get_trace(&self) -> &[TraceEntry]
Get execution trace
Sourcepub fn get_derivation(&self, fact: &RuleAtom) -> Option<&DerivationPath>
pub fn get_derivation(&self, fact: &RuleAtom) -> Option<&DerivationPath>
Get derivation path for a fact
Sourcepub fn get_metrics(&self) -> &PerformanceMetrics
pub fn get_metrics(&self) -> &PerformanceMetrics
Get performance metrics
Sourcepub fn get_conflicts(&self) -> &[RuleConflict]
pub fn get_conflicts(&self) -> &[RuleConflict]
Get detected conflicts
Sourcepub fn generate_debug_report(&self) -> String
pub fn generate_debug_report(&self) -> String
Generate debug report
Sourcepub fn export_debug_data(&self) -> Result<String>
pub fn export_debug_data(&self) -> Result<String>
Export debug data to JSON
Source§impl DebuggableRuleEngine
impl DebuggableRuleEngine
Sourcepub fn add_conditional_breakpoint(
&mut self,
rule_name: &str,
condition: Option<BreakpointCondition>,
hit_count: Option<usize>,
)
pub fn add_conditional_breakpoint( &mut self, rule_name: &str, condition: Option<BreakpointCondition>, hit_count: Option<usize>, )
Add a conditional breakpoint
Sourcepub fn add_watch(&mut self, name: &str, variable: &str, break_on_change: bool)
pub fn add_watch(&mut self, name: &str, variable: &str, break_on_change: bool)
Add a watch expression
Sourcepub fn remove_watch(&mut self, name: &str)
pub fn remove_watch(&mut self, name: &str)
Remove a watch expression
Sourcepub fn get_call_stack(&self) -> &[StackFrame]
pub fn get_call_stack(&self) -> &[StackFrame]
Get current call stack
Sourcepub fn get_substitutions(&self) -> &HashMap<String, String>
pub fn get_substitutions(&self) -> &HashMap<String, String>
Get current variable bindings
Sourcepub fn get_variable(&self, name: &str) -> Option<&String>
pub fn get_variable(&self, name: &str) -> Option<&String>
Get value of a specific variable
Sourcepub fn set_variable(&mut self, name: &str, value: &str)
pub fn set_variable(&mut self, name: &str, value: &str)
Set a variable value (for debugging)
Sourcepub fn execute_command(&mut self, command: DebugCommand) -> String
pub fn execute_command(&mut self, command: DebugCommand) -> String
Execute a debug command
Sourcepub fn should_pause(&self, rule_name: &str) -> bool
pub fn should_pause(&self, rule_name: &str) -> bool
Check if execution should pause
Sourcepub fn push_frame(&mut self, rule_name: &str, input_facts: Vec<RuleAtom>)
pub fn push_frame(&mut self, rule_name: &str, input_facts: Vec<RuleAtom>)
Push a stack frame
Sourcepub fn pop_frame(&mut self) -> Option<StackFrame>
pub fn pop_frame(&mut self) -> Option<StackFrame>
Pop a stack frame
Sourcepub fn update_substitutions(&mut self, substitutions: HashMap<String, String>)
pub fn update_substitutions(&mut self, substitutions: HashMap<String, String>)
Update substitutions
Sourcepub fn get_state(&self) -> DebuggerState
pub fn get_state(&self) -> DebuggerState
Get debugger state
Sourcepub fn get_paused_events(&mut self) -> Vec<String>
pub fn get_paused_events(&mut self) -> Vec<String>
Get paused events
Sourcepub fn increment_hit_count(&mut self, rule_name: &str)
pub fn increment_hit_count(&mut self, rule_name: &str)
Increment hit counter for conditional breakpoint
Sourcepub fn reset_hit_counts(&mut self)
pub fn reset_hit_counts(&mut self)
Reset hit counts for all breakpoints
Sourcepub fn set_breakpoint_enabled(&mut self, index: usize, enabled: bool) -> bool
pub fn set_breakpoint_enabled(&mut self, index: usize, enabled: bool) -> bool
Enable/disable a conditional breakpoint
Trait Implementations§
Source§impl Debug for DebuggableRuleEngine
impl Debug for DebuggableRuleEngine
Auto Trait Implementations§
impl Freeze for DebuggableRuleEngine
impl RefUnwindSafe for DebuggableRuleEngine
impl Send for DebuggableRuleEngine
impl Sync for DebuggableRuleEngine
impl Unpin for DebuggableRuleEngine
impl UnsafeUnpin for DebuggableRuleEngine
impl UnwindSafe for DebuggableRuleEngine
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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