# pane.Pane.swap_with

- **Module:** pane.Pane
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/pane.rs#L907
- **Page:** https://libtmux.org/reference/rs/pane-pane-swap_with/

```
pane.Pane.swap_with(mut, other: &Self) -> Result<&mut Self, Error>
```

Swap this pane's position with another.

# Errors

Returns [`Error::ServerMismatch`] when `other` belongs to another
server, or an error when tmux refuses the swap.
