Skip to main content

tmux_interface/options/window/builder/local/
get_local_window_options.rs

1use crate::options::{GetLocalWindowOption, GetUserOptions, GetWindowOptionsTr};
2use crate::{TmuxCommand, TmuxCommands};
3
4#[derive(Debug)]
5pub struct GetLocalWindowOptions<'a> {
6    pub options: TmuxCommands<'a>,
7}
8
9// XXX: both are same, optimize
10impl<'a> GetWindowOptionsTr<'a, GetLocalWindowOption> for GetLocalWindowOptions<'a> {
11    fn new() -> Self
12    where
13        Self: Sized,
14    {
15        Self {
16            options: TmuxCommands::new(),
17        }
18    }
19
20    fn push<T: Into<TmuxCommand<'a>>>(&mut self, cmd: T) {
21        self.options.push(cmd.into())
22    }
23
24    fn into_commands(self) -> TmuxCommands<'a> {
25        self.options
26    }
27}
28
29impl<'a> GetUserOptions<'a> for GetLocalWindowOptions<'a> {
30    type Getter = GetLocalWindowOption;
31
32    fn push(&mut self, option: TmuxCommand<'a>) {
33        self.options.push(option);
34    }
35}