tmux_interface/options/server/builder/
set_server_options_tr.rs1use crate::{SetClipboard, SetServerOptionTr, Switch, TmuxCommand, TmuxCommands};
2
3use std::borrow::Cow;
4
5pub trait SetServerOptionsTr<'a> {
6 type Setter: SetServerOptionTr;
7
8 fn new() -> Self;
9
10 fn push(&mut self, option: TmuxCommand<'a>);
11
12 fn push_cmds(&mut self, options: TmuxCommands<'a>);
13
14 #[cfg(feature = "tmux_3_1")]
21 fn backspace<S: Into<Cow<'a, str>>>(mut self, backspace: Option<S>) -> Self
22 where
23 Self: Sized,
24 {
25 self.push(Self::Setter::backspace(backspace));
26 self
27 }
28
29 #[cfg(feature = "tmux_1_5")]
36 fn buffer_limit(mut self, buffer_limit: Option<usize>) -> Self
37 where
38 Self: Sized,
39 {
40 self.push(Self::Setter::buffer_limit(buffer_limit));
41 self
42 }
43
44 #[cfg(feature = "tmux_2_4")]
51 fn command_alias<S>(mut self, command_alias: Option<Vec<S>>) -> Self
52 where
53 Self: Sized,
54 S: Into<Cow<'a, str>>,
55 {
56 self.push_cmds(Self::Setter::command_alias(command_alias));
57 self
58 }
59
60 #[cfg(feature = "tmux_3_2")]
67 fn copy_command<S: Into<Cow<'a, str>>>(mut self, copy_command: Option<S>) -> Self
68 where
69 Self: Sized,
70 {
71 self.push(Self::Setter::copy_command(copy_command));
72 self
73 }
74
75 #[cfg(feature = "tmux_2_1")]
82 fn default_terminal<S: Into<Cow<'a, str>>>(mut self, default_terminal: Option<S>) -> Self
83 where
84 Self: Sized,
85 {
86 self.push(Self::Setter::default_terminal(default_terminal));
87 self
88 }
89
90 #[cfg(feature = "tmux_1_2")]
97 fn escape_time(mut self, escape_time: Option<usize>) -> Self
98 where
99 Self: Sized,
100 {
101 self.push(Self::Setter::escape_time(escape_time));
102 self
103 }
104
105 #[cfg(feature = "tmux_3_2")]
112 fn editor<S: Into<Cow<'a, str>>>(mut self, editor: Option<S>) -> Self
113 where
114 Self: Sized,
115 {
116 self.push(Self::Setter::editor(editor));
117 self
118 }
119
120 #[cfg(feature = "tmux_2_7")]
127 fn exit_empty(mut self, exit_empty: Option<Switch>) -> Self
128 where
129 Self: Sized,
130 {
131 self.push(Self::Setter::exit_empty(exit_empty));
132 self
133 }
134
135 #[cfg(feature = "tmux_1_4")]
142 fn exit_unattached(mut self, exit_unattached: Option<Switch>) -> Self
143 where
144 Self: Sized,
145 {
146 self.push(Self::Setter::exit_unattached(exit_unattached));
147 self
148 }
149
150 #[cfg(feature = "tmux_3_2")]
156 fn extended_keys(mut self, extended_keys: Option<Switch>) -> Self
157 where
158 Self: Sized,
159 {
160 self.push(Self::Setter::extended_keys(extended_keys));
161 self
162 }
163
164 #[cfg(feature = "tmux_1_9")]
171 fn focus_events(mut self, focus_events: Option<Switch>) -> Self
172 where
173 Self: Sized,
174 {
175 self.push(Self::Setter::focus_events(focus_events));
176 self
177 }
178
179 #[cfg(feature = "tmux_2_1")]
186 fn history_file<S: Into<Cow<'a, str>>>(mut self, history_file: Option<S>) -> Self
187 where
188 Self: Sized,
189 {
190 self.push(Self::Setter::history_file(history_file));
191 self
192 }
193
194 #[cfg(feature = "tmux_2_0")]
201 fn message_limit(mut self, message_limit: Option<usize>) -> Self
202 where
203 Self: Sized,
204 {
205 self.push(Self::Setter::message_limit(message_limit));
206 self
207 }
208
209 #[cfg(feature = "tmux_3_3")]
216 fn prompt_history_limit(mut self, prompt_history_limit: Option<usize>) -> Self
217 where
218 Self: Sized,
219 {
220 self.push(Self::Setter::prompt_history_limit(prompt_history_limit));
221 self
222 }
223
224 #[cfg(feature = "tmux_1_5")]
231 fn set_clipboard(mut self, set_clipboard: Option<SetClipboard>) -> Self
232 where
233 Self: Sized,
234 {
235 self.push(Self::Setter::set_clipboard(set_clipboard));
236 self
237 }
238
239 #[cfg(feature = "tmux_3_2")]
246 fn terminal_features<S, I>(mut self, terminal_features: Option<I>) -> Self
247 where
248 I: IntoIterator<Item = S>,
249 S: Into<Cow<'a, str>>,
250 Self: Sized,
251 {
252 self.push_cmds(Self::Setter::terminal_features(terminal_features));
253 self
254 }
255
256 #[cfg(feature = "tmux_2_0")]
263 fn terminal_overrides<S>(mut self, terminal_overrides: Option<Vec<S>>) -> Self
264 where
265 Self: Sized,
266 S: Into<Cow<'a, str>>,
267 {
268 self.push_cmds(Self::Setter::terminal_overrides(terminal_overrides));
269 self
270 }
271
272 #[cfg(feature = "tmux_3_0")]
279 fn user_keys<S>(mut self, user_keys: Option<Vec<S>>) -> Self
280 where
281 S: Into<Cow<'a, str>>,
282 Self: Sized,
283 {
284 self.push_cmds(Self::Setter::user_keys(user_keys));
285 self
286 }
287
288 #[cfg(all(feature = "tmux_1_2", not(feature = "tmux_2_0")))]
295 fn quiet(mut self, quiet: Option<Switch>) -> Self
296 where
297 Self: Sized,
298 {
299 self.push(Self::Setter::quiet(quiet));
300 self
301 }
302
303 #[cfg(all(feature = "tmux_1_3", not(feature = "tmux_1_4")))]
310 fn detach_on_destroy(mut self, detach_on_destroy: Option<Switch>) -> Self
311 where
312 Self: Sized,
313 {
314 self.push(Self::Setter::detach_on_destroy(detach_on_destroy));
315 self
316 }
317
318 fn build(self) -> TmuxCommands<'a>;
319}