macro_rules! handle_visit_recursion { (@handle_jump UP) => { ... }; (@handle_jump DOWN) => { ... }; (@handle_jump) => { ... }; ($EXPR:expr $(, $DIRECTION:ident)?) => { ... }; }
Expand description
This macro is used to control continuation behaviors during tree traversals
based on the specified direction. Depending on $DIRECTION
and the value of
the given expression ($EXPR
), which should be a variant of TreeNodeRecursion
,
the macro results in the following behavior:
- If the expression returns
TreeNodeRecursion::Continue
, normal execution continues. - If it returns
TreeNodeRecursion::Stop
, recursion halts and propagatesTreeNodeRecursion::Stop
. - If it returns
TreeNodeRecursion::Jump
, the continuation behavior depends on the traversal direction:- For
UP
direction, the function returns withTreeNodeRecursion::Jump
, bypassing further bottom-up closures until the next top-down closure. - For
DOWN
direction, the function returns withTreeNodeRecursion::Continue
, skipping further exploration. - If no direction is specified,
Jump
is treated likeContinue
.
- For