Rebuilds the mock planner continuation after one step completes.
(
observer: MorselObserver,
planner_name: String,
steps: VecDeque<PlannerStep>,
)
| 483 | |
| 484 | /// Rebuilds the mock planner continuation after one step completes. |
| 485 | fn current_planner_continuation( |
| 486 | observer: MorselObserver, |
| 487 | planner_name: String, |
| 488 | steps: VecDeque<PlannerStep>, |
| 489 | ) -> Vec<Box<dyn MorselPlanner>> { |
| 490 | let only_none_remaining = |
| 491 | matches!(steps.front(), Some(PlannerStep::None)) && steps.len() == 1; |
| 492 | |
| 493 | if steps.is_empty() || only_none_remaining { |
| 494 | Vec::new() |
| 495 | } else { |
| 496 | vec![Box::new(MockMorselPlanner { |
| 497 | observer, |
| 498 | planner_name, |
| 499 | steps, |
| 500 | }) as Box<dyn MorselPlanner>] |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | /// Create any child planners produced by this planning step. |
| 505 | fn child_planners( |