# server.discovery.WindowTree

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

One window and its panes, from [`Server::hierarchy`].

## Example

```rust
use libtmux::SplitDirection;

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("work").await?;
let window = session.active_window().await?.expect("a session has a window");
window.split(SplitDirection::Below).await?;

let tree = guard.server().hierarchy().await?;
let panes: usize = tree
    .iter()
    .flat_map(|branch| branch.windows.iter())
    .map(|branch| branch.panes.len())
    .sum();
assert_eq!(panes, 2);

guard.shutdown().await?;
```

## Members

- `window` (attribute): The window, carrying the link it was reached through.
- `panes` (attribute): Its panes, in tmux's order.
