pub struct CallStack<I> { /* private fields */ }
Expand description
Represents a call stack and its associated locals.
Implementations
sourceimpl<I> CallStack<I>
impl<I> CallStack<I>
sourcepub fn pop_frame(&mut self) -> Option<StackFrame<I>>
pub fn pop_frame(&mut self) -> Option<StackFrame<I>>
Removes the topmost frame from the stack and returns it.
sourcepub fn push_frame(&mut self, frame: StackFrame<I>)
pub fn push_frame(&mut self, frame: StackFrame<I>)
Adds a frame to the top of the stack.
sourcepub fn top_mut(&mut self) -> Option<&mut StackFrame<I>>
pub fn top_mut(&mut self) -> Option<&mut StackFrame<I>>
Returns a mutable reference to the topmost frame in the stack.
sourcepub fn parent_mut(&mut self, depth: usize) -> Option<&mut StackFrame<I>>
pub fn parent_mut(&mut self, depth: usize) -> Option<&mut StackFrame<I>>
Returns a mutable reference to the frame depth
frames below the top of the stack.
sourcepub fn parent(&self, depth: usize) -> Option<&StackFrame<I>>
pub fn parent(&self, depth: usize) -> Option<&StackFrame<I>>
Returns a reference to the frame depth
frames below the top of the stack.
sourcepub fn top(&self) -> Option<&StackFrame<I>>
pub fn top(&self) -> Option<&StackFrame<I>>
Returna reference to the topmost frame in the stack.
sourcepub fn gen_stack_trace(&self) -> String
pub fn gen_stack_trace(&self) -> String
Generates a stack trace string from the current state of the stack.
sourcepub fn set_var_value(
&mut self,
context: &mut Rant,
id: &str,
access: VarAccessMode,
val: RantValue
) -> RuntimeResult<()>
pub fn set_var_value(
&mut self,
context: &mut Rant,
id: &str,
access: VarAccessMode,
val: RantValue
) -> RuntimeResult<()>
Sets a variable’s value using the specified access type.
sourcepub fn get_var_value(
&self,
context: &Rant,
id: &str,
access: VarAccessMode,
prefer_function: bool
) -> RuntimeResult<RantValue>
pub fn get_var_value(
&self,
context: &Rant,
id: &str,
access: VarAccessMode,
prefer_function: bool
) -> RuntimeResult<RantValue>
Gets a variable’s value using the specified access type.
sourcepub fn get_var_mut<'a>(
&'a mut self,
context: &'a mut Rant,
id: &str,
access: VarAccessMode
) -> RuntimeResult<&'a mut RantVar>
pub fn get_var_mut<'a>(
&'a mut self,
context: &'a mut Rant,
id: &str,
access: VarAccessMode
) -> RuntimeResult<&'a mut RantVar>
Gets a mutable reference to a variable.
sourcepub fn def_local_var(&mut self, id: &str, var: RantVar) -> RuntimeResult<()>
pub fn def_local_var(&mut self, id: &str, var: RantVar) -> RuntimeResult<()>
Defines a local variable of the specified name.
Notes
This function does not perform any identifier validation.
sourcepub fn def_var_value(
&mut self,
context: &mut Rant,
id: &str,
access: VarAccessMode,
val: RantValue,
is_const: bool
) -> RuntimeResult<()>
pub fn def_var_value(
&mut self,
context: &mut Rant,
id: &str,
access: VarAccessMode,
val: RantValue,
is_const: bool
) -> RuntimeResult<()>
Defines a variable of the specified name by-value.
Notes
This function does not perform any identifier validation.
sourcepub fn taste_for_first(&self, target_flavor: StackFrameFlavor) -> Option<usize>
pub fn taste_for_first(&self, target_flavor: StackFrameFlavor) -> Option<usize>
Scans (“tastes”) the stack from the top looking for the first occurrence of the specified frame flavor.
Returns the top-relative index of the first occurrence, or None
if no match was found or a stronger flavor was found first.
sourcepub fn taste_for(&self, target_flavor: StackFrameFlavor) -> Option<usize>
pub fn taste_for(&self, target_flavor: StackFrameFlavor) -> Option<usize>
Scans (“tastes”) the stack from the top looking for the first occurrence of the specified frame flavor.
Returns the top-relative index of the first occurrence, or None
if no match was found or another flavor was found first.
Trait Implementations
Auto Trait Implementations
impl<I> !RefUnwindSafe for CallStack<I>
impl<I> !Send for CallStack<I>
impl<I> !Sync for CallStack<I>
impl<I> Unpin for CallStack<I> where
I: Unpin,
impl<I> !UnwindSafe for CallStack<I>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more