use crate::{SetClipboard, SetServerOptionTr, Switch, TmuxCommand, TmuxCommands};
use std::borrow::Cow;
pub trait SetServerOptionsTr<'a> {
type Setter: SetServerOptionTr;
fn new() -> Self;
fn push(&mut self, option: TmuxCommand<'a>);
fn push_cmds(&mut self, options: TmuxCommands<'a>);
#[cfg(feature = "tmux_3_1")]
fn backspace<S: Into<Cow<'a, str>>>(mut self, backspace: Option<S>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::backspace(backspace));
self
}
#[cfg(feature = "tmux_1_5")]
fn buffer_limit(mut self, buffer_limit: Option<usize>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::buffer_limit(buffer_limit));
self
}
#[cfg(feature = "tmux_2_4")]
fn command_alias<S>(mut self, command_alias: Option<Vec<S>>) -> Self
where
Self: Sized,
S: Into<Cow<'a, str>>,
{
self.push_cmds(Self::Setter::command_alias(command_alias));
self
}
#[cfg(feature = "tmux_3_2")]
fn copy_command<S: Into<Cow<'a, str>>>(mut self, copy_command: Option<S>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::copy_command(copy_command));
self
}
#[cfg(feature = "tmux_2_1")]
fn default_terminal<S: Into<Cow<'a, str>>>(mut self, default_terminal: Option<S>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::default_terminal(default_terminal));
self
}
#[cfg(feature = "tmux_1_2")]
fn escape_time(mut self, escape_time: Option<usize>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::escape_time(escape_time));
self
}
#[cfg(feature = "tmux_3_2")]
fn editor<S: Into<Cow<'a, str>>>(mut self, editor: Option<S>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::editor(editor));
self
}
#[cfg(feature = "tmux_2_7")]
fn exit_empty(mut self, exit_empty: Option<Switch>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::exit_empty(exit_empty));
self
}
#[cfg(feature = "tmux_1_4")]
fn exit_unattached(mut self, exit_unattached: Option<Switch>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::exit_unattached(exit_unattached));
self
}
#[cfg(feature = "tmux_3_2")]
fn extended_keys(mut self, extended_keys: Option<Switch>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::extended_keys(extended_keys));
self
}
#[cfg(feature = "tmux_1_9")]
fn focus_events(mut self, focus_events: Option<Switch>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::focus_events(focus_events));
self
}
#[cfg(feature = "tmux_2_1")]
fn history_file<S: Into<Cow<'a, str>>>(mut self, history_file: Option<S>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::history_file(history_file));
self
}
#[cfg(feature = "tmux_2_0")]
fn message_limit(mut self, message_limit: Option<usize>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::message_limit(message_limit));
self
}
#[cfg(feature = "tmux_3_3")]
fn prompt_history_limit(mut self, prompt_history_limit: Option<usize>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::prompt_history_limit(prompt_history_limit));
self
}
#[cfg(feature = "tmux_1_5")]
fn set_clipboard(mut self, set_clipboard: Option<SetClipboard>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::set_clipboard(set_clipboard));
self
}
#[cfg(feature = "tmux_3_2")]
fn terminal_features<S, I>(mut self, terminal_features: Option<I>) -> Self
where
I: IntoIterator<Item = S>,
S: Into<Cow<'a, str>>,
Self: Sized,
{
self.push_cmds(Self::Setter::terminal_features(terminal_features));
self
}
#[cfg(feature = "tmux_2_0")]
fn terminal_overrides<S>(mut self, terminal_overrides: Option<Vec<S>>) -> Self
where
Self: Sized,
S: Into<Cow<'a, str>>,
{
self.push_cmds(Self::Setter::terminal_overrides(terminal_overrides));
self
}
#[cfg(feature = "tmux_3_0")]
fn user_keys<S>(mut self, user_keys: Option<Vec<S>>) -> Self
where
S: Into<Cow<'a, str>>,
Self: Sized,
{
self.push_cmds(Self::Setter::user_keys(user_keys));
self
}
#[cfg(all(feature = "tmux_1_2", not(feature = "tmux_2_0")))]
fn quiet(mut self, quiet: Option<Switch>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::quiet(quiet));
self
}
#[cfg(all(feature = "tmux_1_3", not(feature = "tmux_1_4")))]
fn detach_on_destroy(mut self, detach_on_destroy: Option<Switch>) -> Self
where
Self: Sized,
{
self.push(Self::Setter::detach_on_destroy(detach_on_destroy));
self
}
fn build(self) -> TmuxCommands<'a>;
}