# plan.Chainable

- **Module:** plan
- **Package:** libtmux
- **Language:** Rust
- **Kind:** trait
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/plan.rs#L560
- **Page:** https://libtmux.org/reference/rs/plan-chainable/

An operation that may share one tmux invocation with its neighbours.

A folded run of commands returns one merged stdout with no per-command
boundary, so an operation whose output *is* its answer cannot be folded:
its lines would be indistinguishable from its neighbours'. This trait is
implemented only for the operations where that cannot happen, which makes
[`Plan::chain`] reject the others at compile time.

## Example

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

let pane = "%1".parse::<PaneId>().unwrap();
let mut plan = Plan::new();
// CapturePane is not Chainable: its stdout is the answer.
plan.chain(CapturePane::new(pane));
```
