nm_rs/auto/
setting_team.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir
3// from gtk-girs (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5
6#[cfg(feature = "v1_12")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
8use crate::TeamLinkWatcher;
9use crate::{Setting, ffi};
10use glib::{
11    prelude::*,
12    signal::{SignalHandlerId, connect_raw},
13    translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18    /// Teaming Settings
19    ///
20    /// ## Properties
21    ///
22    ///
23    /// #### `config`
24    ///  The JSON configuration for the team network interface.  The property
25    /// should contain raw JSON configuration data suitable for teamd, because
26    /// the value is passed directly to teamd. If not specified, the default
27    /// configuration is used.  See man teamd.conf for the format details.
28    ///
29    /// Readable | Writeable
30    ///
31    ///
32    /// #### `link-watchers`
33    ///  Link watchers configuration for the connection: each link watcher is
34    /// defined by a dictionary, whose keys depend upon the selected link
35    /// watcher. Available link watchers are 'ethtool', 'nsna_ping' and
36    /// 'arp_ping' and it is specified in the dictionary with the key 'name'.
37    /// Available keys are:   ethtool: 'delay-up', 'delay-down', 'init-wait';
38    /// nsna_ping: 'init-wait', 'interval', 'missed-max', 'target-host';
39    /// arp_ping: all the ones in nsna_ping and 'source-host', 'validate-active',
40    /// 'validate-inactive', 'send-always'. See teamd.conf man for more details.
41    ///
42    /// Readable | Writeable
43    ///
44    ///
45    /// #### `mcast-rejoin-count`
46    ///  Corresponds to the teamd mcast_rejoin.count.
47    ///
48    /// Readable | Writeable
49    ///
50    ///
51    /// #### `mcast-rejoin-interval`
52    ///  Corresponds to the teamd mcast_rejoin.interval.
53    ///
54    /// Readable | Writeable
55    ///
56    ///
57    /// #### `notify-peers-count`
58    ///  Corresponds to the teamd notify_peers.count.
59    ///
60    /// Readable | Writeable
61    ///
62    ///
63    /// #### `notify-peers-interval`
64    ///  Corresponds to the teamd notify_peers.interval.
65    ///
66    /// Readable | Writeable
67    ///
68    ///
69    /// #### `runner`
70    ///  Corresponds to the teamd runner.name.
71    /// Permitted values are: "roundrobin", "broadcast", "activebackup",
72    /// "loadbalance", "lacp", "random".
73    ///
74    /// Readable | Writeable
75    ///
76    ///
77    /// #### `runner-active`
78    ///  Corresponds to the teamd runner.active.
79    ///
80    /// Readable | Writeable
81    ///
82    ///
83    /// #### `runner-agg-select-policy`
84    ///  Corresponds to the teamd runner.agg_select_policy.
85    ///
86    /// Readable | Writeable
87    ///
88    ///
89    /// #### `runner-fast-rate`
90    ///  Corresponds to the teamd runner.fast_rate.
91    ///
92    /// Readable | Writeable
93    ///
94    ///
95    /// #### `runner-hwaddr-policy`
96    ///  Corresponds to the teamd runner.hwaddr_policy.
97    ///
98    /// Readable | Writeable
99    ///
100    ///
101    /// #### `runner-min-ports`
102    ///  Corresponds to the teamd runner.min_ports.
103    ///
104    /// Readable | Writeable
105    ///
106    ///
107    /// #### `runner-sys-prio`
108    ///  Corresponds to the teamd runner.sys_prio.
109    ///
110    /// Readable | Writeable
111    ///
112    ///
113    /// #### `runner-tx-balancer`
114    ///  Corresponds to the teamd runner.tx_balancer.name.
115    ///
116    /// Readable | Writeable
117    ///
118    ///
119    /// #### `runner-tx-balancer-interval`
120    ///  Corresponds to the teamd runner.tx_balancer.interval.
121    ///
122    /// Readable | Writeable
123    ///
124    ///
125    /// #### `runner-tx-hash`
126    ///  Corresponds to the teamd runner.tx_hash.
127    ///
128    /// Readable | Writeable
129    /// <details><summary><h4>Setting</h4></summary>
130    ///
131    ///
132    /// #### `name`
133    ///  The setting's name, which uniquely identifies the setting within the
134    /// connection.  Each setting type has a name unique to that type, for
135    /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
136    ///
137    /// Readable
138    /// </details>
139    ///
140    /// # Implements
141    ///
142    /// [`SettingExt`][trait@crate::prelude::SettingExt]
143    #[doc(alias = "NMSettingTeam")]
144    pub struct SettingTeam(Object<ffi::NMSettingTeam, ffi::NMSettingTeamClass>) @extends Setting;
145
146    match fn {
147        type_ => || ffi::nm_setting_team_get_type(),
148    }
149}
150
151impl SettingTeam {
152    /// Creates a new #NMSettingTeam object with default values.
153    ///
154    /// # Returns
155    ///
156    /// the new empty #NMSettingTeam object
157    #[doc(alias = "nm_setting_team_new")]
158    pub fn new() -> SettingTeam {
159        assert_initialized_main_thread!();
160        unsafe { Setting::from_glib_full(ffi::nm_setting_team_new()).unsafe_cast() }
161    }
162
163    // rustdoc-stripper-ignore-next
164    /// Creates a new builder-pattern struct instance to construct [`SettingTeam`] objects.
165    ///
166    /// This method returns an instance of [`SettingTeamBuilder`](crate::builders::SettingTeamBuilder) which can be used to create [`SettingTeam`] objects.
167    pub fn builder() -> SettingTeamBuilder {
168        SettingTeamBuilder::new()
169    }
170
171    /// Appends a new link watcher to the setting.
172    /// ## `link_watcher`
173    /// the link watcher to add
174    ///
175    /// # Returns
176    ///
177    /// [`true`] if the link watcher is added; [`false`] if an identical link
178    /// watcher was already there.
179    #[cfg(feature = "v1_12")]
180    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
181    #[doc(alias = "nm_setting_team_add_link_watcher")]
182    pub fn add_link_watcher(&self, link_watcher: &TeamLinkWatcher) -> bool {
183        unsafe {
184            from_glib(ffi::nm_setting_team_add_link_watcher(
185                self.to_glib_none().0,
186                link_watcher.to_glib_none().0,
187            ))
188        }
189    }
190
191    #[cfg(feature = "v1_12")]
192    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
193    #[doc(alias = "nm_setting_team_add_runner_tx_hash")]
194    pub fn add_runner_tx_hash(&self, txhash: &str) -> bool {
195        unsafe {
196            from_glib(ffi::nm_setting_team_add_runner_tx_hash(
197                self.to_glib_none().0,
198                txhash.to_glib_none().0,
199            ))
200        }
201    }
202
203    /// Removes all configured link watchers.
204    #[cfg(feature = "v1_12")]
205    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
206    #[doc(alias = "nm_setting_team_clear_link_watchers")]
207    pub fn clear_link_watchers(&self) {
208        unsafe {
209            ffi::nm_setting_team_clear_link_watchers(self.to_glib_none().0);
210        }
211    }
212
213    ///
214    /// # Returns
215    ///
216    /// the #NMSettingTeam:config property of the setting
217    #[doc(alias = "nm_setting_team_get_config")]
218    #[doc(alias = "get_config")]
219    pub fn config(&self) -> glib::GString {
220        unsafe { from_glib_none(ffi::nm_setting_team_get_config(self.to_glib_none().0)) }
221    }
222
223    /// ## `idx`
224    /// index number of the link watcher to return
225    ///
226    /// # Returns
227    ///
228    /// the link watcher at index @idx.
229    #[cfg(feature = "v1_12")]
230    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
231    #[doc(alias = "nm_setting_team_get_link_watcher")]
232    #[doc(alias = "get_link_watcher")]
233    pub fn link_watcher(&self, idx: u32) -> TeamLinkWatcher {
234        unsafe {
235            from_glib_none(ffi::nm_setting_team_get_link_watcher(
236                self.to_glib_none().0,
237                idx,
238            ))
239        }
240    }
241
242    ///
243    /// # Returns
244    ///
245    /// the ##NMSettingTeam:mcast-rejoin-count property of the setting
246    #[cfg(feature = "v1_12")]
247    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
248    #[doc(alias = "nm_setting_team_get_mcast_rejoin_count")]
249    #[doc(alias = "get_mcast_rejoin_count")]
250    #[doc(alias = "mcast-rejoin-count")]
251    pub fn mcast_rejoin_count(&self) -> i32 {
252        unsafe { ffi::nm_setting_team_get_mcast_rejoin_count(self.to_glib_none().0) }
253    }
254
255    ///
256    /// # Returns
257    ///
258    /// the ##NMSettingTeam:mcast-rejoin-interval property of the setting
259    #[cfg(feature = "v1_12")]
260    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
261    #[doc(alias = "nm_setting_team_get_mcast_rejoin_interval")]
262    #[doc(alias = "get_mcast_rejoin_interval")]
263    #[doc(alias = "mcast-rejoin-interval")]
264    pub fn mcast_rejoin_interval(&self) -> i32 {
265        unsafe { ffi::nm_setting_team_get_mcast_rejoin_interval(self.to_glib_none().0) }
266    }
267
268    ///
269    /// # Returns
270    ///
271    /// the ##NMSettingTeam:notify-peers-count property of the setting
272    #[cfg(feature = "v1_12")]
273    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
274    #[doc(alias = "nm_setting_team_get_notify_peers_count")]
275    #[doc(alias = "get_notify_peers_count")]
276    #[doc(alias = "notify-peers-count")]
277    pub fn notify_peers_count(&self) -> i32 {
278        unsafe { ffi::nm_setting_team_get_notify_peers_count(self.to_glib_none().0) }
279    }
280
281    ///
282    /// # Returns
283    ///
284    /// the ##NMSettingTeam:notify-peers-interval property of the setting
285    #[cfg(feature = "v1_12")]
286    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
287    #[doc(alias = "nm_setting_team_get_notify_peers_interval")]
288    #[doc(alias = "get_notify_peers_interval")]
289    #[doc(alias = "notify-peers-interval")]
290    pub fn notify_peers_interval(&self) -> i32 {
291        unsafe { ffi::nm_setting_team_get_notify_peers_interval(self.to_glib_none().0) }
292    }
293
294    ///
295    /// # Returns
296    ///
297    /// the number of configured link watchers
298    #[cfg(feature = "v1_12")]
299    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
300    #[doc(alias = "nm_setting_team_get_num_link_watchers")]
301    #[doc(alias = "get_num_link_watchers")]
302    pub fn num_link_watchers(&self) -> u32 {
303        unsafe { ffi::nm_setting_team_get_num_link_watchers(self.to_glib_none().0) }
304    }
305
306    #[cfg(feature = "v1_12")]
307    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
308    #[doc(alias = "nm_setting_team_get_num_runner_tx_hash")]
309    #[doc(alias = "get_num_runner_tx_hash")]
310    pub fn num_runner_tx_hash(&self) -> u32 {
311        unsafe { ffi::nm_setting_team_get_num_runner_tx_hash(self.to_glib_none().0) }
312    }
313
314    ///
315    /// # Returns
316    ///
317    /// the ##NMSettingTeam:runner property of the setting
318    #[cfg(feature = "v1_12")]
319    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
320    #[doc(alias = "nm_setting_team_get_runner")]
321    #[doc(alias = "get_runner")]
322    pub fn runner(&self) -> glib::GString {
323        unsafe { from_glib_none(ffi::nm_setting_team_get_runner(self.to_glib_none().0)) }
324    }
325
326    ///
327    /// # Returns
328    ///
329    /// the ##NMSettingTeam:runner_active property of the setting
330    #[cfg(feature = "v1_12")]
331    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
332    #[doc(alias = "nm_setting_team_get_runner_active")]
333    #[doc(alias = "get_runner_active")]
334    #[doc(alias = "runner-active")]
335    pub fn is_runner_active(&self) -> bool {
336        unsafe {
337            from_glib(ffi::nm_setting_team_get_runner_active(
338                self.to_glib_none().0,
339            ))
340        }
341    }
342
343    ///
344    /// # Returns
345    ///
346    /// the ##NMSettingTeam:runner-agg-select-policy property of the setting
347    #[cfg(feature = "v1_12")]
348    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
349    #[doc(alias = "nm_setting_team_get_runner_agg_select_policy")]
350    #[doc(alias = "get_runner_agg_select_policy")]
351    #[doc(alias = "runner-agg-select-policy")]
352    pub fn runner_agg_select_policy(&self) -> glib::GString {
353        unsafe {
354            from_glib_none(ffi::nm_setting_team_get_runner_agg_select_policy(
355                self.to_glib_none().0,
356            ))
357        }
358    }
359
360    ///
361    /// # Returns
362    ///
363    /// the ##NMSettingTeam:runner-fast-rate property of the setting
364    #[cfg(feature = "v1_12")]
365    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
366    #[doc(alias = "nm_setting_team_get_runner_fast_rate")]
367    #[doc(alias = "get_runner_fast_rate")]
368    #[doc(alias = "runner-fast-rate")]
369    pub fn is_runner_fast_rate(&self) -> bool {
370        unsafe {
371            from_glib(ffi::nm_setting_team_get_runner_fast_rate(
372                self.to_glib_none().0,
373            ))
374        }
375    }
376
377    ///
378    /// # Returns
379    ///
380    /// the ##NMSettingTeam:runner-hwaddr-policy property of the setting
381    #[cfg(feature = "v1_12")]
382    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
383    #[doc(alias = "nm_setting_team_get_runner_hwaddr_policy")]
384    #[doc(alias = "get_runner_hwaddr_policy")]
385    #[doc(alias = "runner-hwaddr-policy")]
386    pub fn runner_hwaddr_policy(&self) -> glib::GString {
387        unsafe {
388            from_glib_none(ffi::nm_setting_team_get_runner_hwaddr_policy(
389                self.to_glib_none().0,
390            ))
391        }
392    }
393
394    ///
395    /// # Returns
396    ///
397    /// the ##NMSettingTeam:runner-min-ports property of the setting
398    #[cfg(feature = "v1_12")]
399    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
400    #[doc(alias = "nm_setting_team_get_runner_min_ports")]
401    #[doc(alias = "get_runner_min_ports")]
402    #[doc(alias = "runner-min-ports")]
403    pub fn runner_min_ports(&self) -> i32 {
404        unsafe { ffi::nm_setting_team_get_runner_min_ports(self.to_glib_none().0) }
405    }
406
407    ///
408    /// # Returns
409    ///
410    /// the ##NMSettingTeam:runner-sys-prio property of the setting
411    #[cfg(feature = "v1_12")]
412    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
413    #[doc(alias = "nm_setting_team_get_runner_sys_prio")]
414    #[doc(alias = "get_runner_sys_prio")]
415    #[doc(alias = "runner-sys-prio")]
416    pub fn runner_sys_prio(&self) -> i32 {
417        unsafe { ffi::nm_setting_team_get_runner_sys_prio(self.to_glib_none().0) }
418    }
419
420    ///
421    /// # Returns
422    ///
423    /// the ##NMSettingTeam:runner-tx-balancer property of the setting
424    #[cfg(feature = "v1_12")]
425    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
426    #[doc(alias = "nm_setting_team_get_runner_tx_balancer")]
427    #[doc(alias = "get_runner_tx_balancer")]
428    #[doc(alias = "runner-tx-balancer")]
429    pub fn runner_tx_balancer(&self) -> glib::GString {
430        unsafe {
431            from_glib_none(ffi::nm_setting_team_get_runner_tx_balancer(
432                self.to_glib_none().0,
433            ))
434        }
435    }
436
437    ///
438    /// # Returns
439    ///
440    /// the ##NMSettingTeam:runner-tx-balancer_interval property of the setting
441    #[cfg(feature = "v1_12")]
442    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
443    #[doc(alias = "nm_setting_team_get_runner_tx_balancer_interval")]
444    #[doc(alias = "get_runner_tx_balancer_interval")]
445    #[doc(alias = "runner-tx-balancer-interval")]
446    pub fn runner_tx_balancer_interval(&self) -> i32 {
447        unsafe { ffi::nm_setting_team_get_runner_tx_balancer_interval(self.to_glib_none().0) }
448    }
449
450    #[cfg(feature = "v1_12")]
451    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
452    #[doc(alias = "nm_setting_team_get_runner_tx_hash")]
453    #[doc(alias = "get_runner_tx_hash")]
454    #[doc(alias = "runner-tx-hash")]
455    pub fn runner_tx_hash(&self, idx: u32) -> glib::GString {
456        unsafe {
457            from_glib_none(ffi::nm_setting_team_get_runner_tx_hash(
458                self.to_glib_none().0,
459                idx,
460            ))
461        }
462    }
463
464    /// Removes the link watcher at index #idx.
465    /// ## `idx`
466    /// index number of the link watcher to remove
467    #[cfg(feature = "v1_12")]
468    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
469    #[doc(alias = "nm_setting_team_remove_link_watcher")]
470    pub fn remove_link_watcher(&self, idx: u32) {
471        unsafe {
472            ffi::nm_setting_team_remove_link_watcher(self.to_glib_none().0, idx);
473        }
474    }
475
476    /// Removes the link watcher entry matching link_watcher.
477    /// ## `link_watcher`
478    /// the link watcher to remove
479    ///
480    /// # Returns
481    ///
482    /// [`true`] if the link watcher was found and removed, [`false`] otherwise.
483    #[cfg(feature = "v1_12")]
484    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
485    #[doc(alias = "nm_setting_team_remove_link_watcher_by_value")]
486    pub fn remove_link_watcher_by_value(&self, link_watcher: &TeamLinkWatcher) -> bool {
487        unsafe {
488            from_glib(ffi::nm_setting_team_remove_link_watcher_by_value(
489                self.to_glib_none().0,
490                link_watcher.to_glib_none().0,
491            ))
492        }
493    }
494
495    #[cfg(feature = "v1_12")]
496    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
497    #[doc(alias = "nm_setting_team_remove_runner_tx_hash")]
498    pub fn remove_runner_tx_hash(&self, idx: u32) {
499        unsafe {
500            ffi::nm_setting_team_remove_runner_tx_hash(self.to_glib_none().0, idx);
501        }
502    }
503
504    /// Removes the txhash element #txhash
505    /// ## `txhash`
506    /// the txhash element to remove
507    ///
508    /// # Returns
509    ///
510    /// [`true`] if the txhash element was found and removed; [`false`] if it was not.
511    #[cfg(feature = "v1_12")]
512    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
513    #[doc(alias = "nm_setting_team_remove_runner_tx_hash_by_value")]
514    pub fn remove_runner_tx_hash_by_value(&self, txhash: &str) -> bool {
515        unsafe {
516            from_glib(ffi::nm_setting_team_remove_runner_tx_hash_by_value(
517                self.to_glib_none().0,
518                txhash.to_glib_none().0,
519            ))
520        }
521    }
522
523    /// The JSON configuration for the team network interface.  The property
524    /// should contain raw JSON configuration data suitable for teamd, because
525    /// the value is passed directly to teamd. If not specified, the default
526    /// configuration is used.  See man teamd.conf for the format details.
527    pub fn set_config(&self, config: Option<&str>) {
528        ObjectExt::set_property(self, "config", config)
529    }
530
531    /// Link watchers configuration for the connection: each link watcher is
532    /// defined by a dictionary, whose keys depend upon the selected link
533    /// watcher. Available link watchers are 'ethtool', 'nsna_ping' and
534    /// 'arp_ping' and it is specified in the dictionary with the key 'name'.
535    /// Available keys are:   ethtool: 'delay-up', 'delay-down', 'init-wait';
536    /// nsna_ping: 'init-wait', 'interval', 'missed-max', 'target-host';
537    /// arp_ping: all the ones in nsna_ping and 'source-host', 'validate-active',
538    /// 'validate-inactive', 'send-always'. See teamd.conf man for more details.
539    #[cfg(feature = "v1_12")]
540    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
541    #[doc(alias = "link-watchers")]
542    pub fn link_watchers(&self) -> Vec<TeamLinkWatcher> {
543        let vals = ObjectExt::property::<glib::ValueArray>(self, "link-watchers");
544        vals.iter()
545            .map(|value| {
546                use glib::value::FromValue;
547
548                unsafe { TeamLinkWatcher::from_value(value) }
549            })
550            .collect()
551    }
552
553    /// Link watchers configuration for the connection: each link watcher is
554    /// defined by a dictionary, whose keys depend upon the selected link
555    /// watcher. Available link watchers are 'ethtool', 'nsna_ping' and
556    /// 'arp_ping' and it is specified in the dictionary with the key 'name'.
557    /// Available keys are:   ethtool: 'delay-up', 'delay-down', 'init-wait';
558    /// nsna_ping: 'init-wait', 'interval', 'missed-max', 'target-host';
559    /// arp_ping: all the ones in nsna_ping and 'source-host', 'validate-active',
560    /// 'validate-inactive', 'send-always'. See teamd.conf man for more details.
561    #[cfg(feature = "v1_12")]
562    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
563    #[doc(alias = "link-watchers")]
564    pub fn set_link_watchers(&self, link_watchers: &[&TeamLinkWatcher]) {
565        ObjectExt::set_property(
566            self,
567            "link-watchers",
568            link_watchers
569                .iter()
570                .map(|team_link_watcher| team_link_watcher.to_value())
571                .collect::<glib::ValueArray>(),
572        )
573    }
574
575    /// Corresponds to the teamd mcast_rejoin.count.
576    #[cfg(feature = "v1_12")]
577    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
578    #[doc(alias = "mcast-rejoin-count")]
579    pub fn set_mcast_rejoin_count(&self, mcast_rejoin_count: i32) {
580        ObjectExt::set_property(self, "mcast-rejoin-count", mcast_rejoin_count)
581    }
582
583    /// Corresponds to the teamd mcast_rejoin.interval.
584    #[cfg(feature = "v1_12")]
585    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
586    #[doc(alias = "mcast-rejoin-interval")]
587    pub fn set_mcast_rejoin_interval(&self, mcast_rejoin_interval: i32) {
588        ObjectExt::set_property(self, "mcast-rejoin-interval", mcast_rejoin_interval)
589    }
590
591    /// Corresponds to the teamd notify_peers.count.
592    #[cfg(feature = "v1_12")]
593    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
594    #[doc(alias = "notify-peers-count")]
595    pub fn set_notify_peers_count(&self, notify_peers_count: i32) {
596        ObjectExt::set_property(self, "notify-peers-count", notify_peers_count)
597    }
598
599    /// Corresponds to the teamd notify_peers.interval.
600    #[cfg(feature = "v1_12")]
601    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
602    #[doc(alias = "notify-peers-interval")]
603    pub fn set_notify_peers_interval(&self, notify_peers_interval: i32) {
604        ObjectExt::set_property(self, "notify-peers-interval", notify_peers_interval)
605    }
606
607    /// Corresponds to the teamd runner.name.
608    /// Permitted values are: "roundrobin", "broadcast", "activebackup",
609    /// "loadbalance", "lacp", "random".
610    #[cfg(feature = "v1_12")]
611    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
612    pub fn set_runner(&self, runner: Option<&str>) {
613        ObjectExt::set_property(self, "runner", runner)
614    }
615
616    /// Corresponds to the teamd runner.active.
617    #[cfg(feature = "v1_12")]
618    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
619    #[doc(alias = "runner-active")]
620    pub fn set_runner_active(&self, runner_active: bool) {
621        ObjectExt::set_property(self, "runner-active", runner_active)
622    }
623
624    /// Corresponds to the teamd runner.agg_select_policy.
625    #[cfg(feature = "v1_12")]
626    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
627    #[doc(alias = "runner-agg-select-policy")]
628    pub fn set_runner_agg_select_policy(&self, runner_agg_select_policy: Option<&str>) {
629        ObjectExt::set_property(self, "runner-agg-select-policy", runner_agg_select_policy)
630    }
631
632    /// Corresponds to the teamd runner.fast_rate.
633    #[cfg(feature = "v1_12")]
634    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
635    #[doc(alias = "runner-fast-rate")]
636    pub fn set_runner_fast_rate(&self, runner_fast_rate: bool) {
637        ObjectExt::set_property(self, "runner-fast-rate", runner_fast_rate)
638    }
639
640    /// Corresponds to the teamd runner.hwaddr_policy.
641    #[cfg(feature = "v1_12")]
642    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
643    #[doc(alias = "runner-hwaddr-policy")]
644    pub fn set_runner_hwaddr_policy(&self, runner_hwaddr_policy: Option<&str>) {
645        ObjectExt::set_property(self, "runner-hwaddr-policy", runner_hwaddr_policy)
646    }
647
648    /// Corresponds to the teamd runner.min_ports.
649    #[cfg(feature = "v1_12")]
650    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
651    #[doc(alias = "runner-min-ports")]
652    pub fn set_runner_min_ports(&self, runner_min_ports: i32) {
653        ObjectExt::set_property(self, "runner-min-ports", runner_min_ports)
654    }
655
656    /// Corresponds to the teamd runner.sys_prio.
657    #[cfg(feature = "v1_12")]
658    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
659    #[doc(alias = "runner-sys-prio")]
660    pub fn set_runner_sys_prio(&self, runner_sys_prio: i32) {
661        ObjectExt::set_property(self, "runner-sys-prio", runner_sys_prio)
662    }
663
664    /// Corresponds to the teamd runner.tx_balancer.name.
665    #[cfg(feature = "v1_12")]
666    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
667    #[doc(alias = "runner-tx-balancer")]
668    pub fn set_runner_tx_balancer(&self, runner_tx_balancer: Option<&str>) {
669        ObjectExt::set_property(self, "runner-tx-balancer", runner_tx_balancer)
670    }
671
672    /// Corresponds to the teamd runner.tx_balancer.interval.
673    #[cfg(feature = "v1_12")]
674    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
675    #[doc(alias = "runner-tx-balancer-interval")]
676    pub fn set_runner_tx_balancer_interval(&self, runner_tx_balancer_interval: i32) {
677        ObjectExt::set_property(
678            self,
679            "runner-tx-balancer-interval",
680            runner_tx_balancer_interval,
681        )
682    }
683
684    /// Corresponds to the teamd runner.tx_hash.
685    #[cfg(feature = "v1_12")]
686    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
687    #[doc(alias = "runner-tx-hash")]
688    pub fn set_runner_tx_hash(&self, runner_tx_hash: &[&str]) {
689        ObjectExt::set_property(self, "runner-tx-hash", runner_tx_hash)
690    }
691
692    #[doc(alias = "config")]
693    pub fn connect_config_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
694        unsafe extern "C" fn notify_config_trampoline<F: Fn(&SettingTeam) + 'static>(
695            this: *mut ffi::NMSettingTeam,
696            _param_spec: glib::ffi::gpointer,
697            f: glib::ffi::gpointer,
698        ) {
699            let f: &F = &*(f as *const F);
700            f(&from_glib_borrow(this))
701        }
702        unsafe {
703            let f: Box_<F> = Box_::new(f);
704            connect_raw(
705                self.as_ptr() as *mut _,
706                c"notify::config".as_ptr() as *const _,
707                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
708                    notify_config_trampoline::<F> as *const (),
709                )),
710                Box_::into_raw(f),
711            )
712        }
713    }
714
715    #[cfg(feature = "v1_12")]
716    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
717    #[doc(alias = "link-watchers")]
718    pub fn connect_link_watchers_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
719        unsafe extern "C" fn notify_link_watchers_trampoline<F: Fn(&SettingTeam) + 'static>(
720            this: *mut ffi::NMSettingTeam,
721            _param_spec: glib::ffi::gpointer,
722            f: glib::ffi::gpointer,
723        ) {
724            let f: &F = &*(f as *const F);
725            f(&from_glib_borrow(this))
726        }
727        unsafe {
728            let f: Box_<F> = Box_::new(f);
729            connect_raw(
730                self.as_ptr() as *mut _,
731                c"notify::link-watchers".as_ptr() as *const _,
732                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
733                    notify_link_watchers_trampoline::<F> as *const (),
734                )),
735                Box_::into_raw(f),
736            )
737        }
738    }
739
740    #[cfg(feature = "v1_12")]
741    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
742    #[doc(alias = "mcast-rejoin-count")]
743    pub fn connect_mcast_rejoin_count_notify<F: Fn(&Self) + 'static>(
744        &self,
745        f: F,
746    ) -> SignalHandlerId {
747        unsafe extern "C" fn notify_mcast_rejoin_count_trampoline<F: Fn(&SettingTeam) + 'static>(
748            this: *mut ffi::NMSettingTeam,
749            _param_spec: glib::ffi::gpointer,
750            f: glib::ffi::gpointer,
751        ) {
752            let f: &F = &*(f as *const F);
753            f(&from_glib_borrow(this))
754        }
755        unsafe {
756            let f: Box_<F> = Box_::new(f);
757            connect_raw(
758                self.as_ptr() as *mut _,
759                c"notify::mcast-rejoin-count".as_ptr() as *const _,
760                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
761                    notify_mcast_rejoin_count_trampoline::<F> as *const (),
762                )),
763                Box_::into_raw(f),
764            )
765        }
766    }
767
768    #[cfg(feature = "v1_12")]
769    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
770    #[doc(alias = "mcast-rejoin-interval")]
771    pub fn connect_mcast_rejoin_interval_notify<F: Fn(&Self) + 'static>(
772        &self,
773        f: F,
774    ) -> SignalHandlerId {
775        unsafe extern "C" fn notify_mcast_rejoin_interval_trampoline<
776            F: Fn(&SettingTeam) + 'static,
777        >(
778            this: *mut ffi::NMSettingTeam,
779            _param_spec: glib::ffi::gpointer,
780            f: glib::ffi::gpointer,
781        ) {
782            let f: &F = &*(f as *const F);
783            f(&from_glib_borrow(this))
784        }
785        unsafe {
786            let f: Box_<F> = Box_::new(f);
787            connect_raw(
788                self.as_ptr() as *mut _,
789                c"notify::mcast-rejoin-interval".as_ptr() as *const _,
790                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
791                    notify_mcast_rejoin_interval_trampoline::<F> as *const (),
792                )),
793                Box_::into_raw(f),
794            )
795        }
796    }
797
798    #[cfg(feature = "v1_12")]
799    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
800    #[doc(alias = "notify-peers-count")]
801    pub fn connect_notify_peers_count_notify<F: Fn(&Self) + 'static>(
802        &self,
803        f: F,
804    ) -> SignalHandlerId {
805        unsafe extern "C" fn notify_notify_peers_count_trampoline<F: Fn(&SettingTeam) + 'static>(
806            this: *mut ffi::NMSettingTeam,
807            _param_spec: glib::ffi::gpointer,
808            f: glib::ffi::gpointer,
809        ) {
810            let f: &F = &*(f as *const F);
811            f(&from_glib_borrow(this))
812        }
813        unsafe {
814            let f: Box_<F> = Box_::new(f);
815            connect_raw(
816                self.as_ptr() as *mut _,
817                c"notify::notify-peers-count".as_ptr() as *const _,
818                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
819                    notify_notify_peers_count_trampoline::<F> as *const (),
820                )),
821                Box_::into_raw(f),
822            )
823        }
824    }
825
826    #[cfg(feature = "v1_12")]
827    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
828    #[doc(alias = "notify-peers-interval")]
829    pub fn connect_notify_peers_interval_notify<F: Fn(&Self) + 'static>(
830        &self,
831        f: F,
832    ) -> SignalHandlerId {
833        unsafe extern "C" fn notify_notify_peers_interval_trampoline<
834            F: Fn(&SettingTeam) + 'static,
835        >(
836            this: *mut ffi::NMSettingTeam,
837            _param_spec: glib::ffi::gpointer,
838            f: glib::ffi::gpointer,
839        ) {
840            let f: &F = &*(f as *const F);
841            f(&from_glib_borrow(this))
842        }
843        unsafe {
844            let f: Box_<F> = Box_::new(f);
845            connect_raw(
846                self.as_ptr() as *mut _,
847                c"notify::notify-peers-interval".as_ptr() as *const _,
848                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
849                    notify_notify_peers_interval_trampoline::<F> as *const (),
850                )),
851                Box_::into_raw(f),
852            )
853        }
854    }
855
856    #[cfg(feature = "v1_12")]
857    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
858    #[doc(alias = "runner")]
859    pub fn connect_runner_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
860        unsafe extern "C" fn notify_runner_trampoline<F: Fn(&SettingTeam) + 'static>(
861            this: *mut ffi::NMSettingTeam,
862            _param_spec: glib::ffi::gpointer,
863            f: glib::ffi::gpointer,
864        ) {
865            let f: &F = &*(f as *const F);
866            f(&from_glib_borrow(this))
867        }
868        unsafe {
869            let f: Box_<F> = Box_::new(f);
870            connect_raw(
871                self.as_ptr() as *mut _,
872                c"notify::runner".as_ptr() as *const _,
873                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
874                    notify_runner_trampoline::<F> as *const (),
875                )),
876                Box_::into_raw(f),
877            )
878        }
879    }
880
881    #[cfg(feature = "v1_12")]
882    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
883    #[doc(alias = "runner-active")]
884    pub fn connect_runner_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
885        unsafe extern "C" fn notify_runner_active_trampoline<F: Fn(&SettingTeam) + 'static>(
886            this: *mut ffi::NMSettingTeam,
887            _param_spec: glib::ffi::gpointer,
888            f: glib::ffi::gpointer,
889        ) {
890            let f: &F = &*(f as *const F);
891            f(&from_glib_borrow(this))
892        }
893        unsafe {
894            let f: Box_<F> = Box_::new(f);
895            connect_raw(
896                self.as_ptr() as *mut _,
897                c"notify::runner-active".as_ptr() as *const _,
898                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
899                    notify_runner_active_trampoline::<F> as *const (),
900                )),
901                Box_::into_raw(f),
902            )
903        }
904    }
905
906    #[cfg(feature = "v1_12")]
907    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
908    #[doc(alias = "runner-agg-select-policy")]
909    pub fn connect_runner_agg_select_policy_notify<F: Fn(&Self) + 'static>(
910        &self,
911        f: F,
912    ) -> SignalHandlerId {
913        unsafe extern "C" fn notify_runner_agg_select_policy_trampoline<
914            F: Fn(&SettingTeam) + 'static,
915        >(
916            this: *mut ffi::NMSettingTeam,
917            _param_spec: glib::ffi::gpointer,
918            f: glib::ffi::gpointer,
919        ) {
920            let f: &F = &*(f as *const F);
921            f(&from_glib_borrow(this))
922        }
923        unsafe {
924            let f: Box_<F> = Box_::new(f);
925            connect_raw(
926                self.as_ptr() as *mut _,
927                c"notify::runner-agg-select-policy".as_ptr() as *const _,
928                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
929                    notify_runner_agg_select_policy_trampoline::<F> as *const (),
930                )),
931                Box_::into_raw(f),
932            )
933        }
934    }
935
936    #[cfg(feature = "v1_12")]
937    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
938    #[doc(alias = "runner-fast-rate")]
939    pub fn connect_runner_fast_rate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
940        unsafe extern "C" fn notify_runner_fast_rate_trampoline<F: Fn(&SettingTeam) + 'static>(
941            this: *mut ffi::NMSettingTeam,
942            _param_spec: glib::ffi::gpointer,
943            f: glib::ffi::gpointer,
944        ) {
945            let f: &F = &*(f as *const F);
946            f(&from_glib_borrow(this))
947        }
948        unsafe {
949            let f: Box_<F> = Box_::new(f);
950            connect_raw(
951                self.as_ptr() as *mut _,
952                c"notify::runner-fast-rate".as_ptr() as *const _,
953                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
954                    notify_runner_fast_rate_trampoline::<F> as *const (),
955                )),
956                Box_::into_raw(f),
957            )
958        }
959    }
960
961    #[cfg(feature = "v1_12")]
962    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
963    #[doc(alias = "runner-hwaddr-policy")]
964    pub fn connect_runner_hwaddr_policy_notify<F: Fn(&Self) + 'static>(
965        &self,
966        f: F,
967    ) -> SignalHandlerId {
968        unsafe extern "C" fn notify_runner_hwaddr_policy_trampoline<
969            F: Fn(&SettingTeam) + 'static,
970        >(
971            this: *mut ffi::NMSettingTeam,
972            _param_spec: glib::ffi::gpointer,
973            f: glib::ffi::gpointer,
974        ) {
975            let f: &F = &*(f as *const F);
976            f(&from_glib_borrow(this))
977        }
978        unsafe {
979            let f: Box_<F> = Box_::new(f);
980            connect_raw(
981                self.as_ptr() as *mut _,
982                c"notify::runner-hwaddr-policy".as_ptr() as *const _,
983                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
984                    notify_runner_hwaddr_policy_trampoline::<F> as *const (),
985                )),
986                Box_::into_raw(f),
987            )
988        }
989    }
990
991    #[cfg(feature = "v1_12")]
992    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
993    #[doc(alias = "runner-min-ports")]
994    pub fn connect_runner_min_ports_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
995        unsafe extern "C" fn notify_runner_min_ports_trampoline<F: Fn(&SettingTeam) + 'static>(
996            this: *mut ffi::NMSettingTeam,
997            _param_spec: glib::ffi::gpointer,
998            f: glib::ffi::gpointer,
999        ) {
1000            let f: &F = &*(f as *const F);
1001            f(&from_glib_borrow(this))
1002        }
1003        unsafe {
1004            let f: Box_<F> = Box_::new(f);
1005            connect_raw(
1006                self.as_ptr() as *mut _,
1007                c"notify::runner-min-ports".as_ptr() as *const _,
1008                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1009                    notify_runner_min_ports_trampoline::<F> as *const (),
1010                )),
1011                Box_::into_raw(f),
1012            )
1013        }
1014    }
1015
1016    #[cfg(feature = "v1_12")]
1017    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1018    #[doc(alias = "runner-sys-prio")]
1019    pub fn connect_runner_sys_prio_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1020        unsafe extern "C" fn notify_runner_sys_prio_trampoline<F: Fn(&SettingTeam) + 'static>(
1021            this: *mut ffi::NMSettingTeam,
1022            _param_spec: glib::ffi::gpointer,
1023            f: glib::ffi::gpointer,
1024        ) {
1025            let f: &F = &*(f as *const F);
1026            f(&from_glib_borrow(this))
1027        }
1028        unsafe {
1029            let f: Box_<F> = Box_::new(f);
1030            connect_raw(
1031                self.as_ptr() as *mut _,
1032                c"notify::runner-sys-prio".as_ptr() as *const _,
1033                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1034                    notify_runner_sys_prio_trampoline::<F> as *const (),
1035                )),
1036                Box_::into_raw(f),
1037            )
1038        }
1039    }
1040
1041    #[cfg(feature = "v1_12")]
1042    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1043    #[doc(alias = "runner-tx-balancer")]
1044    pub fn connect_runner_tx_balancer_notify<F: Fn(&Self) + 'static>(
1045        &self,
1046        f: F,
1047    ) -> SignalHandlerId {
1048        unsafe extern "C" fn notify_runner_tx_balancer_trampoline<F: Fn(&SettingTeam) + 'static>(
1049            this: *mut ffi::NMSettingTeam,
1050            _param_spec: glib::ffi::gpointer,
1051            f: glib::ffi::gpointer,
1052        ) {
1053            let f: &F = &*(f as *const F);
1054            f(&from_glib_borrow(this))
1055        }
1056        unsafe {
1057            let f: Box_<F> = Box_::new(f);
1058            connect_raw(
1059                self.as_ptr() as *mut _,
1060                c"notify::runner-tx-balancer".as_ptr() as *const _,
1061                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1062                    notify_runner_tx_balancer_trampoline::<F> as *const (),
1063                )),
1064                Box_::into_raw(f),
1065            )
1066        }
1067    }
1068
1069    #[cfg(feature = "v1_12")]
1070    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1071    #[doc(alias = "runner-tx-balancer-interval")]
1072    pub fn connect_runner_tx_balancer_interval_notify<F: Fn(&Self) + 'static>(
1073        &self,
1074        f: F,
1075    ) -> SignalHandlerId {
1076        unsafe extern "C" fn notify_runner_tx_balancer_interval_trampoline<
1077            F: Fn(&SettingTeam) + 'static,
1078        >(
1079            this: *mut ffi::NMSettingTeam,
1080            _param_spec: glib::ffi::gpointer,
1081            f: glib::ffi::gpointer,
1082        ) {
1083            let f: &F = &*(f as *const F);
1084            f(&from_glib_borrow(this))
1085        }
1086        unsafe {
1087            let f: Box_<F> = Box_::new(f);
1088            connect_raw(
1089                self.as_ptr() as *mut _,
1090                c"notify::runner-tx-balancer-interval".as_ptr() as *const _,
1091                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1092                    notify_runner_tx_balancer_interval_trampoline::<F> as *const (),
1093                )),
1094                Box_::into_raw(f),
1095            )
1096        }
1097    }
1098
1099    #[cfg(feature = "v1_12")]
1100    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1101    #[doc(alias = "runner-tx-hash")]
1102    pub fn connect_runner_tx_hash_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1103        unsafe extern "C" fn notify_runner_tx_hash_trampoline<F: Fn(&SettingTeam) + 'static>(
1104            this: *mut ffi::NMSettingTeam,
1105            _param_spec: glib::ffi::gpointer,
1106            f: glib::ffi::gpointer,
1107        ) {
1108            let f: &F = &*(f as *const F);
1109            f(&from_glib_borrow(this))
1110        }
1111        unsafe {
1112            let f: Box_<F> = Box_::new(f);
1113            connect_raw(
1114                self.as_ptr() as *mut _,
1115                c"notify::runner-tx-hash".as_ptr() as *const _,
1116                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1117                    notify_runner_tx_hash_trampoline::<F> as *const (),
1118                )),
1119                Box_::into_raw(f),
1120            )
1121        }
1122    }
1123}
1124
1125impl Default for SettingTeam {
1126    fn default() -> Self {
1127        Self::new()
1128    }
1129}
1130
1131// rustdoc-stripper-ignore-next
1132/// A [builder-pattern] type to construct [`SettingTeam`] objects.
1133///
1134/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1135#[must_use = "The builder must be built to be used"]
1136pub struct SettingTeamBuilder {
1137    builder: glib::object::ObjectBuilder<'static, SettingTeam>,
1138}
1139
1140impl SettingTeamBuilder {
1141    fn new() -> Self {
1142        Self {
1143            builder: glib::object::Object::builder(),
1144        }
1145    }
1146
1147    /// The JSON configuration for the team network interface.  The property
1148    /// should contain raw JSON configuration data suitable for teamd, because
1149    /// the value is passed directly to teamd. If not specified, the default
1150    /// configuration is used.  See man teamd.conf for the format details.
1151    pub fn config(self, config: impl Into<glib::GString>) -> Self {
1152        Self {
1153            builder: self.builder.property("config", config.into()),
1154        }
1155    }
1156
1157    /// Link watchers configuration for the connection: each link watcher is
1158    /// defined by a dictionary, whose keys depend upon the selected link
1159    /// watcher. Available link watchers are 'ethtool', 'nsna_ping' and
1160    /// 'arp_ping' and it is specified in the dictionary with the key 'name'.
1161    /// Available keys are:   ethtool: 'delay-up', 'delay-down', 'init-wait';
1162    /// nsna_ping: 'init-wait', 'interval', 'missed-max', 'target-host';
1163    /// arp_ping: all the ones in nsna_ping and 'source-host', 'validate-active',
1164    /// 'validate-inactive', 'send-always'. See teamd.conf man for more details.
1165    #[cfg(feature = "v1_12")]
1166    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1167    pub fn link_watchers(self, link_watchers: &[&TeamLinkWatcher]) -> Self {
1168        Self {
1169            builder: self.builder.property(
1170                "link-watchers",
1171                link_watchers
1172                    .iter()
1173                    .map(|team_link_watcher| team_link_watcher.to_value())
1174                    .collect::<glib::ValueArray>(),
1175            ),
1176        }
1177    }
1178
1179    /// Corresponds to the teamd mcast_rejoin.count.
1180    #[cfg(feature = "v1_12")]
1181    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1182    pub fn mcast_rejoin_count(self, mcast_rejoin_count: i32) -> Self {
1183        Self {
1184            builder: self
1185                .builder
1186                .property("mcast-rejoin-count", mcast_rejoin_count),
1187        }
1188    }
1189
1190    /// Corresponds to the teamd mcast_rejoin.interval.
1191    #[cfg(feature = "v1_12")]
1192    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1193    pub fn mcast_rejoin_interval(self, mcast_rejoin_interval: i32) -> Self {
1194        Self {
1195            builder: self
1196                .builder
1197                .property("mcast-rejoin-interval", mcast_rejoin_interval),
1198        }
1199    }
1200
1201    /// Corresponds to the teamd notify_peers.count.
1202    #[cfg(feature = "v1_12")]
1203    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1204    pub fn notify_peers_count(self, notify_peers_count: i32) -> Self {
1205        Self {
1206            builder: self
1207                .builder
1208                .property("notify-peers-count", notify_peers_count),
1209        }
1210    }
1211
1212    /// Corresponds to the teamd notify_peers.interval.
1213    #[cfg(feature = "v1_12")]
1214    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1215    pub fn notify_peers_interval(self, notify_peers_interval: i32) -> Self {
1216        Self {
1217            builder: self
1218                .builder
1219                .property("notify-peers-interval", notify_peers_interval),
1220        }
1221    }
1222
1223    /// Corresponds to the teamd runner.name.
1224    /// Permitted values are: "roundrobin", "broadcast", "activebackup",
1225    /// "loadbalance", "lacp", "random".
1226    #[cfg(feature = "v1_12")]
1227    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1228    pub fn runner(self, runner: impl Into<glib::GString>) -> Self {
1229        Self {
1230            builder: self.builder.property("runner", runner.into()),
1231        }
1232    }
1233
1234    /// Corresponds to the teamd runner.active.
1235    #[cfg(feature = "v1_12")]
1236    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1237    pub fn runner_active(self, runner_active: bool) -> Self {
1238        Self {
1239            builder: self.builder.property("runner-active", runner_active),
1240        }
1241    }
1242
1243    /// Corresponds to the teamd runner.agg_select_policy.
1244    #[cfg(feature = "v1_12")]
1245    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1246    pub fn runner_agg_select_policy(
1247        self,
1248        runner_agg_select_policy: impl Into<glib::GString>,
1249    ) -> Self {
1250        Self {
1251            builder: self
1252                .builder
1253                .property("runner-agg-select-policy", runner_agg_select_policy.into()),
1254        }
1255    }
1256
1257    /// Corresponds to the teamd runner.fast_rate.
1258    #[cfg(feature = "v1_12")]
1259    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1260    pub fn runner_fast_rate(self, runner_fast_rate: bool) -> Self {
1261        Self {
1262            builder: self.builder.property("runner-fast-rate", runner_fast_rate),
1263        }
1264    }
1265
1266    /// Corresponds to the teamd runner.hwaddr_policy.
1267    #[cfg(feature = "v1_12")]
1268    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1269    pub fn runner_hwaddr_policy(self, runner_hwaddr_policy: impl Into<glib::GString>) -> Self {
1270        Self {
1271            builder: self
1272                .builder
1273                .property("runner-hwaddr-policy", runner_hwaddr_policy.into()),
1274        }
1275    }
1276
1277    /// Corresponds to the teamd runner.min_ports.
1278    #[cfg(feature = "v1_12")]
1279    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1280    pub fn runner_min_ports(self, runner_min_ports: i32) -> Self {
1281        Self {
1282            builder: self.builder.property("runner-min-ports", runner_min_ports),
1283        }
1284    }
1285
1286    /// Corresponds to the teamd runner.sys_prio.
1287    #[cfg(feature = "v1_12")]
1288    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1289    pub fn runner_sys_prio(self, runner_sys_prio: i32) -> Self {
1290        Self {
1291            builder: self.builder.property("runner-sys-prio", runner_sys_prio),
1292        }
1293    }
1294
1295    /// Corresponds to the teamd runner.tx_balancer.name.
1296    #[cfg(feature = "v1_12")]
1297    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1298    pub fn runner_tx_balancer(self, runner_tx_balancer: impl Into<glib::GString>) -> Self {
1299        Self {
1300            builder: self
1301                .builder
1302                .property("runner-tx-balancer", runner_tx_balancer.into()),
1303        }
1304    }
1305
1306    /// Corresponds to the teamd runner.tx_balancer.interval.
1307    #[cfg(feature = "v1_12")]
1308    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1309    pub fn runner_tx_balancer_interval(self, runner_tx_balancer_interval: i32) -> Self {
1310        Self {
1311            builder: self
1312                .builder
1313                .property("runner-tx-balancer-interval", runner_tx_balancer_interval),
1314        }
1315    }
1316
1317    /// Corresponds to the teamd runner.tx_hash.
1318    #[cfg(feature = "v1_12")]
1319    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
1320    pub fn runner_tx_hash(self, runner_tx_hash: impl Into<glib::StrV>) -> Self {
1321        Self {
1322            builder: self
1323                .builder
1324                .property("runner-tx-hash", runner_tx_hash.into()),
1325        }
1326    }
1327
1328    // rustdoc-stripper-ignore-next
1329    /// Build the [`SettingTeam`].
1330    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1331    pub fn build(self) -> SettingTeam {
1332        assert_initialized_main_thread!();
1333        self.builder.build()
1334    }
1335}