tmux_interface/options/window/builder/global/
set_global_window_options.rs

1use crate::options::{SetGlobalWindowOption, SetUserOptions, SetWindowOptionsTr};
2use crate::{TmuxCommand, TmuxCommands};
3
4#[derive(Debug)]
5pub struct SetGlobalWindowOptions<'a> {
6    pub options: TmuxCommands<'a>,
7}
8
9impl<'a> SetWindowOptionsTr<'a> for SetGlobalWindowOptions<'a> {
10    type Setter = SetGlobalWindowOption;
11
12    fn new() -> Self {
13        Self {
14            options: TmuxCommands::new(),
15        }
16    }
17
18    fn push(&mut self, option: TmuxCommand<'a>) {
19        self.options.push(option);
20    }
21
22    fn push_cmds(&mut self, options: TmuxCommands<'a>) {
23        self.options.push_cmds(options);
24    }
25
26    fn build(self) -> TmuxCommands<'a> {
27        self.options
28    }
29}
30
31impl<'a> SetUserOptions<'a> for SetGlobalWindowOptions<'a> {
32    type Setter = SetGlobalWindowOption;
33
34    fn push(&mut self, option: TmuxCommand<'a>) {
35        self.options.push(option);
36    }
37}