pub enum TraversalInterrupt {
ReturnValue(Rc<Value>),
Error(Error),
}
Expand description
Represents an interruption in traversal of the AST.
The reasons traversal may be interrupted are:
- An error in encountered, in which case backtrack all the way up the call stack and
return the error to the caller of the
eval_program()
function. - Or, a
Return
statement in encountered.
In the case of a Return
statement, the code backtracks up the call stack to the
point where the function containing the Return
statement was called, and hands
over the return value to the caller. If the return statement was used outside of a
function, and the code reaches the end of the call stack, it is treated as an error.
Variants§
Auto Trait Implementations§
impl Freeze for TraversalInterrupt
impl !RefUnwindSafe for TraversalInterrupt
impl !Send for TraversalInterrupt
impl !Sync for TraversalInterrupt
impl Unpin for TraversalInterrupt
impl !UnwindSafe for TraversalInterrupt
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