pub struct ContextStack { /* private fields */ }Expand description
Manages evaluation contexts without recursion
Implementations§
Source§impl ContextStack
impl ContextStack
Sourcepub fn push_context(
&mut self,
ctx: Option<Rc<EvalContext>>,
) -> Result<usize, ExprError>
pub fn push_context( &mut self, ctx: Option<Rc<EvalContext>>, ) -> Result<usize, ExprError>
Push a context onto the stack, returning its ID
Sourcepub fn push_context_with_parent(
&mut self,
ctx: EvalContext,
parent_id: usize,
) -> Result<usize, ExprError>
pub fn push_context_with_parent( &mut self, ctx: EvalContext, parent_id: usize, ) -> Result<usize, ExprError>
Push a new context with a specified parent
Sourcepub fn get_context(&self, id: usize) -> Option<&Rc<EvalContext>>
pub fn get_context(&self, id: usize) -> Option<&Rc<EvalContext>>
Get a context by ID
Sourcepub fn lookup_variable(&self, ctx_id: usize, name: &HString) -> Option<Real>
pub fn lookup_variable(&self, ctx_id: usize, name: &HString) -> Option<Real>
Look up a variable, checking parent contexts if needed
Sourcepub fn get_parent_id(&self, ctx_id: usize) -> Option<usize>
pub fn get_parent_id(&self, ctx_id: usize) -> Option<usize>
Get the parent ID of a context