1#[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 #[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 #[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 pub fn builder() -> SettingTeamBuilder {
168 SettingTeamBuilder::new()
169 }
170
171 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 pub fn set_config(&self, config: Option<&str>) {
528 ObjectExt::set_property(self, "config", config)
529 }
530
531 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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#[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 pub fn config(self, config: impl Into<glib::GString>) -> Self {
1152 Self {
1153 builder: self.builder.property("config", config.into()),
1154 }
1155 }
1156
1157 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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}