pub struct Evaluator<'a> { /* private fields */ }Implementations§
Source§impl<'a> Evaluator<'a>
impl<'a> Evaluator<'a>
pub fn new(env: &'a mut Environment, program: &'a Program) -> Self
pub fn exec(&mut self) -> RexxResult<ExecSignal>
Sourcepub fn set_main_args(&mut self, args: Vec<RexxValue>)
pub fn set_main_args(&mut self, args: Vec<RexxValue>)
Public setter so main.rs can push CLI arguments for the main program.
Sourcepub fn set_command_handler(
&mut self,
handler: Box<dyn FnMut(&str, &str) -> Option<i32>>,
)
pub fn set_command_handler( &mut self, handler: Box<dyn FnMut(&str, &str) -> Option<i32>>, )
Set a custom command handler for ADDRESS environments.
The handler receives (address_environment, command_string) and returns:
Some(rc)if it handled the command (rc is the return code)Noneif the command should fall through to default shell execution
This allows embedding applications (like XEDIT) to intercept commands sent to custom ADDRESS environments.
Sourcepub fn set_command_handler_with_env(
&mut self,
handler: Box<dyn FnMut(&str, &str, &mut EnvVars<'_>) -> Option<i32>>,
)
pub fn set_command_handler_with_env( &mut self, handler: Box<dyn FnMut(&str, &str, &mut EnvVars<'_>) -> Option<i32>>, )
Set a custom command handler that receives an EnvVars handle for
reading and writing REXX variables.
The handler receives (address_environment, command_string, vars) and returns:
Some(rc)if it handled the command (rc is the return code)Noneif the command should fall through to the next handler or default shell execution
This handler is tried before the basic command_handler. It allows embedding
applications (like XEDIT) to inspect and update REXX variables during command
execution — for example, refreshing EXTRACT stem variables after state-changing
commands. The EnvVars wrapper restricts access to variable operations only,
preventing handlers from mutating ADDRESS routing or PROCEDURE scoping.
§Panics
Handlers must not panic. If a handler panics the panic propagates through
the evaluator; if the caller catches the unwind, the handler slot is left empty
and subsequent commands fall through to command_handler or shell execution.