# plan.Plan.run

- **Module:** plan.Plan
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/plan/run.rs#L310
- **Page:** https://libtmux.org/en/rs/latest/reference/plan-plan-run/

```
plan.Plan.run(self, server: &Server, planner: Planner) -> Result<PlanResult, Error>
```

Run this plan, grouping it with `planner`.

The result does not depend on the planner; the number of tmux
invocations, and how precisely a failure can be attributed, do.

# Errors

Returns an error when tmux cannot be reached, a process cannot be
captured, a slot dependency is invalid, or a creating operation does
not return valid IDs. Validation happens before the first command. A
command tmux *refuses* is reported through the returned [`PlanResult`],
not as an error, because a plan may expect one.

On a handle from `Server::over_control_mode`, a plan holding a
[`super::ops::Pause`] fails with
[`crate::ControlModeErrorKind::BlockingCommand`] before anything is
sent, as [`Self::run_over_control_mode`] does.

# Cancel safety

The effect can be partial: steps already dispatched stay done, and the
[`PlanResult`] naming them, with the ids of what they created, is lost
with the future. A retry runs the whole plan again.
