Struct brane_exe::frame_stack::FrameStack
source · pub struct FrameStack { /* private fields */ }
Expand description
Implements a FrameStack, which is used to keep track of function calls and their expected return types.
Implementations§
source§impl FrameStack
impl FrameStack
sourcepub fn fork(&self) -> Self
pub fn fork(&self) -> Self
Forks the framestack, which copies the existing variables in-scope into a single frame that is the new main.
§Returns
A new FrameStack instance that can be used in a forked thread.
sourcepub fn update_table(&mut self, table: Arc<SymTable>)
pub fn update_table(&mut self, table: Arc<SymTable>)
sourcepub fn pop(&mut self) -> Result<(ProgramCounter, DataType), Error>
pub fn pop(&mut self) -> Result<(ProgramCounter, DataType), Error>
Pops the top value off of the FrameStack, returning the expected data type and return address.
§Returns
A ProgramCounter
denoting the return address and expected return type, respectively. If the main was popped, however, then the return address is (usize::MAX, usize::MAX)
.
§Errors
This function may error if there was nothing left on the stack.
sourcepub fn set(&mut self, def: usize, value: Value) -> Result<(), Error>
pub fn set(&mut self, def: usize, value: Value) -> Result<(), Error>
Sets the variable with the given index to the given Value.
§Arguments
def
: The variable to set.value
: The new Value to set it to.
§Returns
Nothing, but does update the given variable’s value.
§Errors
This function may error if there was nothing left on the stack or if the given variable was not declared.
Trait Implementations§
source§impl Clone for FrameStack
impl Clone for FrameStack
source§fn clone(&self) -> FrameStack
fn clone(&self) -> FrameStack
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for FrameStack
impl RefUnwindSafe for FrameStack
impl Send for FrameStack
impl Sync for FrameStack
impl Unpin for FrameStack
impl UnwindSafe for FrameStack
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request