Function resolve_next
pub fn resolve_next(ctx: &RouteCtx<'_>) -> NextStepExpand description
Pick the next step, preserving linear behavior when no routing is declared.
Resolution precedence (highest to lowest). The branches are mutually exclusive — only one of them fires per call — so the linear narrative reads as a decision tree, not a fallback chain:
- False top-level
whenguard → terminal completes; otherwise the linear successor is taken.switchports androuting.nextare bypassed entirely. - True or absent top-level
whenguard with a non-emptyswitch→ the first matching port’sgotois taken, or the run completes if no port matches.routing.nextand the linear successor are NOT consulted. - True or absent top-level
whenguard with noswitchand a declaredrouting.next→ that explicit successor is taken (visit limit, dependency, and existence checks still apply). - True or absent top-level
whenguard with noswitchand norouting.next→terminal: truecompletes the run; otherwise the linear successor (current_step + 1) is taken.