pub struct CallStack<I> { /* private fields */ }
Expand description
Represents a call stack and its associated locals.
Implementations
Removes the topmost frame from the stack and returns it.
Adds a frame to the top of the stack.
Returns a mutable reference to the topmost frame in the stack.
Returns a mutable reference to the frame depth
frames below the top of the stack.
Returns a reference to the frame depth
frames below the top of the stack.
Returna reference to the topmost frame in the stack.
Generates a stack trace string from the current state of the stack.
pub 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.
pub 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.
pub 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.
Defines a local variable of the specified name.
Notes
This function does not perform any identifier validation.
pub 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.
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.
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.