Module yash_env::stack

source ·
Expand description

Runtime execution context stack

The “stack” traces the state of execution context at runtime. For example, when entering a subshell, the runner pushes Frame::Subshell to the stack. By examining the stack, commands executed in the subshell can detect that they are inside the subshell.

This module provides guards to ensure stack frames are pushed and popped correctly. The push function returns a guard that will pop the frame when dropped. Implementing Deref and DerefMut, the guard allows access to the borrowed stack or environment.

Stack::push returns a StackFrameGuard that allows re-borrowing the Stack. Env::push_frame returns a EnvFrameGuard that implements DerefMut<Target = Env>.

Structs§

  • Information about the currently executing built-in
  • RAII-style guard that makes sure a stack frame is popped properly
  • Runtime execution context stack
  • RAII-style guard that makes sure a stack frame is popped properly

Enums§

  • Element of runtime execution context stack