# config.Workspace.to_yaml

- **Module:** config.Workspace
- **Package:** tmux-workspace
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/tmux-workspace/src/config.rs#L875
- **Page:** https://libtmux.org/en/rs/latest/workspace/reference/config-workspace-to_yaml/

```
config.Workspace.to_yaml(self) -> String
```

Render this workspace as tmuxp-style YAML.

Emits the keys this crate acts on and nothing else, so a document that
came from [`Self::from_yaml`] and back may be shorter than it started:
what is dropped is what `unsupported_keys` already named.

## Example

```rust
use tmux_workspace::Workspace;

let workspace = Workspace::from_yaml(
    "
session_name: demo
windows:
  - window_name: editor
    panes: [htop]
",
)?;

// What it writes, it can read.
assert_eq!(Workspace::from_yaml(&workspace.to_yaml())?, workspace);
```
