# plan.Plan

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

Operations recorded but not yet run.

## Example

```rust
use libtmux::plan::{Plan, RenameWindow, SendKeys};
use libtmux::{PaneId, WindowId};

let mut plan = Plan::new();
plan.add(SendKeys::new("%1".parse::<PaneId>()?).text("clear").enter());
plan.add(RenameWindow::new("@1".parse::<WindowId>()?, "ready"));

// Nothing has run: the plan can be read first.
let rendered = plan.preview();
assert_eq!(rendered.len(), 2);
assert!(rendered[0].as_ref().is_some_and(|c| c.summary().to_string().contains("send-keys")));
```

## Members

- `new` (method): Start an empty plan.
- `add` (method): Record one operation and return a handle to what it creates.
- `chain` (method): Record an operation that is allowed to share a tmux invocation.
- `steps` (method): The recorded operations, in order.
- `len` (method): How many operations are recorded.
- `is_empty` (method): Whether nothing is recorded.
- `validate` (method): Check every step before a run can change tmux state.
- `preview` (method): Render every operation without running any of them.
- `run` (method): Run this plan, grouping it with `planner`.
- `run_over_control_mode` (method): Run this plan over an open control-mode connection.
