tmux_interface/options/common/user_option/
get_user_options.rs

1use crate::options::GetUserOption;
2use crate::TmuxCommand;
3use std::borrow::Cow;
4
5pub trait GetUserOptions<'a> {
6    type Getter: GetUserOption;
7
8    fn push(&mut self, option: TmuxCommand<'a>);
9
10    fn user_option<S>(mut self, name: S) -> Self
11    where
12        Self: Sized,
13        S: Into<Cow<'a, str>>,
14    {
15        self.push(Self::Getter::user_option(name));
16        self
17    }
18
19    /// # Manual
20    ///
21    /// ```text
22    /// @user-option-name value
23    /// ```
24    fn user_option_ext<T, S>(mut self, target: Option<T>, name: S) -> Self
25    where
26        Self: Sized,
27        T: Into<Cow<'a, str>>,
28        S: Into<Cow<'a, str>>,
29    {
30        self.push(Self::Getter::user_option_ext(target, name));
31        self
32    }
33}