pub enum StackFrame {
Source(Identifier, SymbolMap),
Module(Identifier, SymbolMap),
Init(SymbolMap),
Workbench(Model, Identifier, SymbolMap),
Body(SymbolMap),
Function(SymbolMap),
Call {
symbol: Symbol,
args: ArgumentValueList,
src_ref: SrcRef,
},
}Expand description
Frame in Stack for local variables, aliases (use statements) and calls.
A stack frame can have different types and some provide a storage for local variables
like StackFrame::Source and StackFrame::Body) and some do not, some have a id
like StackFrame::Source amd StackFrame::Module) and some do not and
Call is used for procedural calls.
Each frame store some of these information:
- an
Identifier - local variables in a
SymbolMap(e.g.i = 5;) - local aliases in a
SymbolMap(e.g.use std::print;) - argument value list (e.g.
f(x = 0, y = 1);
Variants§
Source(Identifier, SymbolMap)
Source file with locals.
Module(Identifier, SymbolMap)
Module scope with locals.
Init(SymbolMap)
initializer scope with locals.
Workbench(Model, Identifier, SymbolMap)
Part scope with locals.
Body(SymbolMap)
Body (scope) with locals.
Function(SymbolMap)
Function body
Call
A call (e.g. og function or part).
Implementations§
Source§impl StackFrame
impl StackFrame
Sourcepub fn id(&self) -> Option<Identifier>
pub fn id(&self) -> Option<Identifier>
Get identifier if available or panic.
Sourcepub fn print_locals(
&self,
f: &mut Formatter<'_>,
idx: usize,
depth: usize,
) -> Result
pub fn print_locals( &self, f: &mut Formatter<'_>, idx: usize, depth: usize, ) -> Result
Print stack frame.
Sourcepub fn print_stack(
&self,
f: &mut dyn Write,
source_by_hash: &impl GetSourceByHash,
idx: usize,
) -> Result
pub fn print_stack( &self, f: &mut dyn Write, source_by_hash: &impl GetSourceByHash, idx: usize, ) -> Result
Pretty print single call stack frame.
Auto Trait Implementations§
impl Freeze for StackFrame
impl !RefUnwindSafe for StackFrame
impl !Send for StackFrame
impl !Sync for StackFrame
impl Unpin for StackFrame
impl !UnwindSafe for StackFrame
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more