Skip to main content

Evaluator

Struct Evaluator 

Source
pub struct Evaluator<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Evaluator<'a>

Source

pub fn new(env: &'a mut Environment, program: &'a Program) -> Self

Source

pub fn exec(&mut self) -> RexxResult<ExecSignal>

Source

pub fn set_main_args(&mut self, args: Vec<RexxValue>)

Public setter so main.rs can push CLI arguments for the main program.

Source

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)
  • None if the command should fall through to default shell execution

This allows embedding applications (like XEDIT) to intercept commands sent to custom ADDRESS environments.

Source

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)
  • None if 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.

Source

pub fn queue_len(&self) -> usize

Return the current queue length (for QUEUED() BIF).

Auto Trait Implementations§

§

impl<'a> Freeze for Evaluator<'a>

§

impl<'a> !RefUnwindSafe for Evaluator<'a>

§

impl<'a> !Send for Evaluator<'a>

§

impl<'a> !Sync for Evaluator<'a>

§

impl<'a> Unpin for Evaluator<'a>

§

impl<'a> UnsafeUnpin for Evaluator<'a>

§

impl<'a> !UnwindSafe for Evaluator<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V