Skip to main content

DebugHook

Trait DebugHook 

Source
pub trait DebugHook {
    // Required method
    fn at_checkpoint(&mut self, state: &mut dyn DebugState) -> DebugAction;

    // Provided methods
    fn wants_kkt_capture(&self) -> bool { ... }
    fn arm(&mut self) { ... }
}
Expand description

A consumer that a solver pauses at each Checkpoint. The CLI’s REPL / agent driver is the production implementation; the same hook instance can drive any solver that exposes a DebugState.

Required Methods§

Source

fn at_checkpoint(&mut self, state: &mut dyn DebugState) -> DebugAction

Called at every checkpoint. Inspect and/or mutate via state, then return whether to keep solving.

Provided Methods§

Source

fn wants_kkt_capture(&self) -> bool

Whether the solver should capture the (heavier) KKT matrix triplets and LDLᵀ factor this iteration, so viz kkt / viz L can look back at the previous iteration’s system. True while stepping interactively; a detached (running-free) hook returns false so the O(nnz) assembly isn’t paid every iteration. The cheap inertia/status fields are captured regardless.

Source

fn arm(&mut self)

Arm the hook to pause at the next checkpoint. Used to debug a sub-solve on demand — an outer driver can re-arm this interior-point hook just before a particular solve, so the hook stays quiet otherwise but drops in for that one solve. Default: no-op (always-on hooks ignore it).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§