# window.Window.swap_with

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

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

Swap this window's position with another.

# Errors

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