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
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ContextStack
impl !Send for ContextStack
impl !Sync for ContextStack
impl !UnwindSafe for ContextStack
impl Freeze for ContextStack
impl Unpin for ContextStack
impl UnsafeUnpin for ContextStack
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more