On this page
config.Workspace.from_yaml
- Module
- config
- Declared in
- Workspace
- Package
- libtmux
- Source
- crates/tmux-workspace/src/config.rs
- from_yaml ( source : &str ) Result<Self, ConfigError>
-
Parse one workspace from tmuxp-style YAML.
This accepts the shape tmuxp uses for the parts a builder needs. It is deliberately not a full tmuxp implementation: unknown keys are ignored rather than rejected, so a richer tmuxp file still loads.
Errors
Returns an error when the document is not valid YAML, does not hold exactly one workspace, or is missing
session_name.Examples
use tmux_workspace::Workspace; let workspace = Workspace::from_yaml( " session_name: demo windows: - window_name: editor panes: - echo one - shell_command: echo two ", )?; assert_eq!(workspace.session_name, "demo"); assert_eq!(workspace.windows.len(), 1); assert_eq!(workspace.windows[0].panes.len(), 2);
0 declared, 0 inherited