pub trait SubRoutineStack {
// Required methods
fn len(&self) -> usize;
fn routine_idx(&self) -> usize;
fn set_routine_idx(&mut self, idx: usize);
fn push(&mut self, old_program_counter: usize, new_idx: usize) -> bool;
fn pop(&mut self) -> Option<usize>;
// Provided method
fn is_empty(&self) -> bool { ... }
}
Required Methods§
fn len(&self) -> usize
fn routine_idx(&self) -> usize
Sourcefn set_routine_idx(&mut self, idx: usize)
fn set_routine_idx(&mut self, idx: usize)
Sets new code section without touching subroutine stack.