#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
use crate::TeamLinkWatcher;
use crate::{Setting, ffi};
use glib::{
prelude::*,
signal::{SignalHandlerId, connect_raw},
translate::*,
};
use std::boxed::Box as Box_;
glib::wrapper! {
#[doc(alias = "NMSettingTeam")]
pub struct SettingTeam(Object<ffi::NMSettingTeam, ffi::NMSettingTeamClass>) @extends Setting;
match fn {
type_ => || ffi::nm_setting_team_get_type(),
}
}
impl SettingTeam {
#[doc(alias = "nm_setting_team_new")]
pub fn new() -> SettingTeam {
assert_initialized_main_thread!();
unsafe { Setting::from_glib_full(ffi::nm_setting_team_new()).unsafe_cast() }
}
pub fn builder() -> SettingTeamBuilder {
SettingTeamBuilder::new()
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_add_link_watcher")]
pub fn add_link_watcher(&self, link_watcher: &TeamLinkWatcher) -> bool {
unsafe {
from_glib(ffi::nm_setting_team_add_link_watcher(
self.to_glib_none().0,
link_watcher.to_glib_none().0,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_add_runner_tx_hash")]
pub fn add_runner_tx_hash(&self, txhash: &str) -> bool {
unsafe {
from_glib(ffi::nm_setting_team_add_runner_tx_hash(
self.to_glib_none().0,
txhash.to_glib_none().0,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_clear_link_watchers")]
pub fn clear_link_watchers(&self) {
unsafe {
ffi::nm_setting_team_clear_link_watchers(self.to_glib_none().0);
}
}
#[doc(alias = "nm_setting_team_get_config")]
#[doc(alias = "get_config")]
pub fn config(&self) -> glib::GString {
unsafe { from_glib_none(ffi::nm_setting_team_get_config(self.to_glib_none().0)) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_link_watcher")]
#[doc(alias = "get_link_watcher")]
pub fn link_watcher(&self, idx: u32) -> TeamLinkWatcher {
unsafe {
from_glib_none(ffi::nm_setting_team_get_link_watcher(
self.to_glib_none().0,
idx,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_mcast_rejoin_count")]
#[doc(alias = "get_mcast_rejoin_count")]
#[doc(alias = "mcast-rejoin-count")]
pub fn mcast_rejoin_count(&self) -> i32 {
unsafe { ffi::nm_setting_team_get_mcast_rejoin_count(self.to_glib_none().0) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_mcast_rejoin_interval")]
#[doc(alias = "get_mcast_rejoin_interval")]
#[doc(alias = "mcast-rejoin-interval")]
pub fn mcast_rejoin_interval(&self) -> i32 {
unsafe { ffi::nm_setting_team_get_mcast_rejoin_interval(self.to_glib_none().0) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_notify_peers_count")]
#[doc(alias = "get_notify_peers_count")]
#[doc(alias = "notify-peers-count")]
pub fn notify_peers_count(&self) -> i32 {
unsafe { ffi::nm_setting_team_get_notify_peers_count(self.to_glib_none().0) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_notify_peers_interval")]
#[doc(alias = "get_notify_peers_interval")]
#[doc(alias = "notify-peers-interval")]
pub fn notify_peers_interval(&self) -> i32 {
unsafe { ffi::nm_setting_team_get_notify_peers_interval(self.to_glib_none().0) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_num_link_watchers")]
#[doc(alias = "get_num_link_watchers")]
pub fn num_link_watchers(&self) -> u32 {
unsafe { ffi::nm_setting_team_get_num_link_watchers(self.to_glib_none().0) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_num_runner_tx_hash")]
#[doc(alias = "get_num_runner_tx_hash")]
pub fn num_runner_tx_hash(&self) -> u32 {
unsafe { ffi::nm_setting_team_get_num_runner_tx_hash(self.to_glib_none().0) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner")]
#[doc(alias = "get_runner")]
pub fn runner(&self) -> glib::GString {
unsafe { from_glib_none(ffi::nm_setting_team_get_runner(self.to_glib_none().0)) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner_active")]
#[doc(alias = "get_runner_active")]
#[doc(alias = "runner-active")]
pub fn is_runner_active(&self) -> bool {
unsafe {
from_glib(ffi::nm_setting_team_get_runner_active(
self.to_glib_none().0,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner_agg_select_policy")]
#[doc(alias = "get_runner_agg_select_policy")]
#[doc(alias = "runner-agg-select-policy")]
pub fn runner_agg_select_policy(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_team_get_runner_agg_select_policy(
self.to_glib_none().0,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner_fast_rate")]
#[doc(alias = "get_runner_fast_rate")]
#[doc(alias = "runner-fast-rate")]
pub fn is_runner_fast_rate(&self) -> bool {
unsafe {
from_glib(ffi::nm_setting_team_get_runner_fast_rate(
self.to_glib_none().0,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner_hwaddr_policy")]
#[doc(alias = "get_runner_hwaddr_policy")]
#[doc(alias = "runner-hwaddr-policy")]
pub fn runner_hwaddr_policy(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_team_get_runner_hwaddr_policy(
self.to_glib_none().0,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner_min_ports")]
#[doc(alias = "get_runner_min_ports")]
#[doc(alias = "runner-min-ports")]
pub fn runner_min_ports(&self) -> i32 {
unsafe { ffi::nm_setting_team_get_runner_min_ports(self.to_glib_none().0) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner_sys_prio")]
#[doc(alias = "get_runner_sys_prio")]
#[doc(alias = "runner-sys-prio")]
pub fn runner_sys_prio(&self) -> i32 {
unsafe { ffi::nm_setting_team_get_runner_sys_prio(self.to_glib_none().0) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner_tx_balancer")]
#[doc(alias = "get_runner_tx_balancer")]
#[doc(alias = "runner-tx-balancer")]
pub fn runner_tx_balancer(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_team_get_runner_tx_balancer(
self.to_glib_none().0,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner_tx_balancer_interval")]
#[doc(alias = "get_runner_tx_balancer_interval")]
#[doc(alias = "runner-tx-balancer-interval")]
pub fn runner_tx_balancer_interval(&self) -> i32 {
unsafe { ffi::nm_setting_team_get_runner_tx_balancer_interval(self.to_glib_none().0) }
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_get_runner_tx_hash")]
#[doc(alias = "get_runner_tx_hash")]
#[doc(alias = "runner-tx-hash")]
pub fn runner_tx_hash(&self, idx: u32) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_team_get_runner_tx_hash(
self.to_glib_none().0,
idx,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_remove_link_watcher")]
pub fn remove_link_watcher(&self, idx: u32) {
unsafe {
ffi::nm_setting_team_remove_link_watcher(self.to_glib_none().0, idx);
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_remove_link_watcher_by_value")]
pub fn remove_link_watcher_by_value(&self, link_watcher: &TeamLinkWatcher) -> bool {
unsafe {
from_glib(ffi::nm_setting_team_remove_link_watcher_by_value(
self.to_glib_none().0,
link_watcher.to_glib_none().0,
))
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_remove_runner_tx_hash")]
pub fn remove_runner_tx_hash(&self, idx: u32) {
unsafe {
ffi::nm_setting_team_remove_runner_tx_hash(self.to_glib_none().0, idx);
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_team_remove_runner_tx_hash_by_value")]
pub fn remove_runner_tx_hash_by_value(&self, txhash: &str) -> bool {
unsafe {
from_glib(ffi::nm_setting_team_remove_runner_tx_hash_by_value(
self.to_glib_none().0,
txhash.to_glib_none().0,
))
}
}
pub fn set_config(&self, config: Option<&str>) {
ObjectExt::set_property(self, "config", config)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "link-watchers")]
pub fn link_watchers(&self) -> Vec<TeamLinkWatcher> {
let vals = ObjectExt::property::<glib::ValueArray>(self, "link-watchers");
vals.iter()
.map(|value| {
use glib::value::FromValue;
unsafe { TeamLinkWatcher::from_value(value) }
})
.collect()
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "link-watchers")]
pub fn set_link_watchers(&self, link_watchers: &[&TeamLinkWatcher]) {
ObjectExt::set_property(
self,
"link-watchers",
link_watchers
.iter()
.map(|team_link_watcher| team_link_watcher.to_value())
.collect::<glib::ValueArray>(),
)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "mcast-rejoin-count")]
pub fn set_mcast_rejoin_count(&self, mcast_rejoin_count: i32) {
ObjectExt::set_property(self, "mcast-rejoin-count", mcast_rejoin_count)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "mcast-rejoin-interval")]
pub fn set_mcast_rejoin_interval(&self, mcast_rejoin_interval: i32) {
ObjectExt::set_property(self, "mcast-rejoin-interval", mcast_rejoin_interval)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "notify-peers-count")]
pub fn set_notify_peers_count(&self, notify_peers_count: i32) {
ObjectExt::set_property(self, "notify-peers-count", notify_peers_count)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "notify-peers-interval")]
pub fn set_notify_peers_interval(&self, notify_peers_interval: i32) {
ObjectExt::set_property(self, "notify-peers-interval", notify_peers_interval)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn set_runner(&self, runner: Option<&str>) {
ObjectExt::set_property(self, "runner", runner)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-active")]
pub fn set_runner_active(&self, runner_active: bool) {
ObjectExt::set_property(self, "runner-active", runner_active)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-agg-select-policy")]
pub fn set_runner_agg_select_policy(&self, runner_agg_select_policy: Option<&str>) {
ObjectExt::set_property(self, "runner-agg-select-policy", runner_agg_select_policy)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-fast-rate")]
pub fn set_runner_fast_rate(&self, runner_fast_rate: bool) {
ObjectExt::set_property(self, "runner-fast-rate", runner_fast_rate)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-hwaddr-policy")]
pub fn set_runner_hwaddr_policy(&self, runner_hwaddr_policy: Option<&str>) {
ObjectExt::set_property(self, "runner-hwaddr-policy", runner_hwaddr_policy)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-min-ports")]
pub fn set_runner_min_ports(&self, runner_min_ports: i32) {
ObjectExt::set_property(self, "runner-min-ports", runner_min_ports)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-sys-prio")]
pub fn set_runner_sys_prio(&self, runner_sys_prio: i32) {
ObjectExt::set_property(self, "runner-sys-prio", runner_sys_prio)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-tx-balancer")]
pub fn set_runner_tx_balancer(&self, runner_tx_balancer: Option<&str>) {
ObjectExt::set_property(self, "runner-tx-balancer", runner_tx_balancer)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-tx-balancer-interval")]
pub fn set_runner_tx_balancer_interval(&self, runner_tx_balancer_interval: i32) {
ObjectExt::set_property(
self,
"runner-tx-balancer-interval",
runner_tx_balancer_interval,
)
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-tx-hash")]
pub fn set_runner_tx_hash(&self, runner_tx_hash: &[&str]) {
ObjectExt::set_property(self, "runner-tx-hash", runner_tx_hash)
}
#[doc(alias = "config")]
pub fn connect_config_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_config_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::config".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_config_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "link-watchers")]
pub fn connect_link_watchers_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_link_watchers_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::link-watchers".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_link_watchers_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "mcast-rejoin-count")]
pub fn connect_mcast_rejoin_count_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_mcast_rejoin_count_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::mcast-rejoin-count".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_mcast_rejoin_count_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "mcast-rejoin-interval")]
pub fn connect_mcast_rejoin_interval_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_mcast_rejoin_interval_trampoline<
F: Fn(&SettingTeam) + 'static,
>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::mcast-rejoin-interval".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_mcast_rejoin_interval_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "notify-peers-count")]
pub fn connect_notify_peers_count_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_notify_peers_count_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::notify-peers-count".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_notify_peers_count_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "notify-peers-interval")]
pub fn connect_notify_peers_interval_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_notify_peers_interval_trampoline<
F: Fn(&SettingTeam) + 'static,
>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::notify-peers-interval".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_notify_peers_interval_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner")]
pub fn connect_runner_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-active")]
pub fn connect_runner_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_active_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner-active".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_active_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-agg-select-policy")]
pub fn connect_runner_agg_select_policy_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_agg_select_policy_trampoline<
F: Fn(&SettingTeam) + 'static,
>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner-agg-select-policy".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_agg_select_policy_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-fast-rate")]
pub fn connect_runner_fast_rate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_fast_rate_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner-fast-rate".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_fast_rate_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-hwaddr-policy")]
pub fn connect_runner_hwaddr_policy_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_hwaddr_policy_trampoline<
F: Fn(&SettingTeam) + 'static,
>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner-hwaddr-policy".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_hwaddr_policy_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-min-ports")]
pub fn connect_runner_min_ports_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_min_ports_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner-min-ports".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_min_ports_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-sys-prio")]
pub fn connect_runner_sys_prio_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_sys_prio_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner-sys-prio".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_sys_prio_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-tx-balancer")]
pub fn connect_runner_tx_balancer_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_tx_balancer_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner-tx-balancer".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_tx_balancer_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-tx-balancer-interval")]
pub fn connect_runner_tx_balancer_interval_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_tx_balancer_interval_trampoline<
F: Fn(&SettingTeam) + 'static,
>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner-tx-balancer-interval".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_tx_balancer_interval_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "runner-tx-hash")]
pub fn connect_runner_tx_hash_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_runner_tx_hash_trampoline<F: Fn(&SettingTeam) + 'static>(
this: *mut ffi::NMSettingTeam,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
c"notify::runner-tx-hash".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
notify_runner_tx_hash_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl Default for SettingTeam {
fn default() -> Self {
Self::new()
}
}
#[must_use = "The builder must be built to be used"]
pub struct SettingTeamBuilder {
builder: glib::object::ObjectBuilder<'static, SettingTeam>,
}
impl SettingTeamBuilder {
fn new() -> Self {
Self {
builder: glib::object::Object::builder(),
}
}
pub fn config(self, config: impl Into<glib::GString>) -> Self {
Self {
builder: self.builder.property("config", config.into()),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn link_watchers(self, link_watchers: &[&TeamLinkWatcher]) -> Self {
Self {
builder: self.builder.property(
"link-watchers",
link_watchers
.iter()
.map(|team_link_watcher| team_link_watcher.to_value())
.collect::<glib::ValueArray>(),
),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn mcast_rejoin_count(self, mcast_rejoin_count: i32) -> Self {
Self {
builder: self
.builder
.property("mcast-rejoin-count", mcast_rejoin_count),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn mcast_rejoin_interval(self, mcast_rejoin_interval: i32) -> Self {
Self {
builder: self
.builder
.property("mcast-rejoin-interval", mcast_rejoin_interval),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn notify_peers_count(self, notify_peers_count: i32) -> Self {
Self {
builder: self
.builder
.property("notify-peers-count", notify_peers_count),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn notify_peers_interval(self, notify_peers_interval: i32) -> Self {
Self {
builder: self
.builder
.property("notify-peers-interval", notify_peers_interval),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner(self, runner: impl Into<glib::GString>) -> Self {
Self {
builder: self.builder.property("runner", runner.into()),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner_active(self, runner_active: bool) -> Self {
Self {
builder: self.builder.property("runner-active", runner_active),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner_agg_select_policy(
self,
runner_agg_select_policy: impl Into<glib::GString>,
) -> Self {
Self {
builder: self
.builder
.property("runner-agg-select-policy", runner_agg_select_policy.into()),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner_fast_rate(self, runner_fast_rate: bool) -> Self {
Self {
builder: self.builder.property("runner-fast-rate", runner_fast_rate),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner_hwaddr_policy(self, runner_hwaddr_policy: impl Into<glib::GString>) -> Self {
Self {
builder: self
.builder
.property("runner-hwaddr-policy", runner_hwaddr_policy.into()),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner_min_ports(self, runner_min_ports: i32) -> Self {
Self {
builder: self.builder.property("runner-min-ports", runner_min_ports),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner_sys_prio(self, runner_sys_prio: i32) -> Self {
Self {
builder: self.builder.property("runner-sys-prio", runner_sys_prio),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner_tx_balancer(self, runner_tx_balancer: impl Into<glib::GString>) -> Self {
Self {
builder: self
.builder
.property("runner-tx-balancer", runner_tx_balancer.into()),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner_tx_balancer_interval(self, runner_tx_balancer_interval: i32) -> Self {
Self {
builder: self
.builder
.property("runner-tx-balancer-interval", runner_tx_balancer_interval),
}
}
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
pub fn runner_tx_hash(self, runner_tx_hash: impl Into<glib::StrV>) -> Self {
Self {
builder: self
.builder
.property("runner-tx-hash", runner_tx_hash.into()),
}
}
#[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
pub fn build(self) -> SettingTeam {
assert_initialized_main_thread!();
self.builder.build()
}
}