pub trait DebugContext:
Clone
+ Copy
+ Debug {
// Provided methods
fn enter_block(engine_state: &EngineState, block: &Block) { ... }
fn leave_block(engine_state: &EngineState, block: &Block) { ... }
fn enter_element(engine_state: &EngineState, element: &PipelineElement) { ... }
fn leave_element(
engine_state: &EngineState,
element: &PipelineElement,
result: &Result<PipelineData, ShellError>,
) { ... }
fn enter_instruction(
engine_state: &EngineState,
ir_block: &IrBlock,
instruction_index: usize,
registers: &[PipelineData],
) { ... }
fn leave_instruction(
engine_state: &EngineState,
ir_block: &IrBlock,
instruction_index: usize,
registers: &[PipelineData],
error: Option<&ShellError>,
) { ... }
}
Expand description
Trait used for static dispatch of eval_xxx()
evaluator calls
DebugContext implements the same interface as Debugger (except activate() and deactivate(). It is intended to be implemented only by two structs
- WithDebug which calls down to the Debugger methods
- WithoutDebug with default implementation, i.e., empty calls to be optimized away
Provided Methods§
Sourcefn enter_block(engine_state: &EngineState, block: &Block)
fn enter_block(engine_state: &EngineState, block: &Block)
Called when the evaluator enters a block
Sourcefn leave_block(engine_state: &EngineState, block: &Block)
fn leave_block(engine_state: &EngineState, block: &Block)
Called when the evaluator leaves a block
Sourcefn enter_element(engine_state: &EngineState, element: &PipelineElement)
fn enter_element(engine_state: &EngineState, element: &PipelineElement)
Called when the AST evaluator enters a pipeline element
Sourcefn leave_element(
engine_state: &EngineState,
element: &PipelineElement,
result: &Result<PipelineData, ShellError>,
)
fn leave_element( engine_state: &EngineState, element: &PipelineElement, result: &Result<PipelineData, ShellError>, )
Called when the AST evaluator leaves a pipeline element
Sourcefn enter_instruction(
engine_state: &EngineState,
ir_block: &IrBlock,
instruction_index: usize,
registers: &[PipelineData],
)
fn enter_instruction( engine_state: &EngineState, ir_block: &IrBlock, instruction_index: usize, registers: &[PipelineData], )
Called before the IR evaluator runs an instruction
Sourcefn leave_instruction(
engine_state: &EngineState,
ir_block: &IrBlock,
instruction_index: usize,
registers: &[PipelineData],
error: Option<&ShellError>,
)
fn leave_instruction( engine_state: &EngineState, ir_block: &IrBlock, instruction_index: usize, registers: &[PipelineData], error: Option<&ShellError>, )
Called after the IR evaluator runs an instruction
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.