# plan.Plan.chain

- **Module:** plan.Plan
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/plan.rs#L925
- **Page:** https://libtmux.org/reference/rs/plan-plan-chain/

```
plan.Plan.chain(mut, operation: O) -> O::Creates
```

Record an operation that is allowed to share a tmux invocation.

Identical to [`Plan::add`] except that the compiler rejects an
operation whose output could not be told apart from its neighbours'.
Use it to say that intent at the call site; a folding [`Planner`]
reaches the same grouping on its own.

## Example

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

let mut plan = Plan::new();
plan.chain(SendKeys::new("%1".parse::<PaneId>()?).text("make").enter());
```
