nm_rs/auto/
setting_wimax.rs1#![allow(deprecated)]
6
7use crate::{ffi,Setting};
8use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
9use std::{boxed::Box as Box_};
10
11glib::wrapper! {
12 #[doc(alias = "NMSettingWimax")]
45 pub struct SettingWimax(Object<ffi::NMSettingWimax, ffi::NMSettingWimaxClass>) @extends Setting;
46
47 match fn {
48 type_ => || ffi::nm_setting_wimax_get_type(),
49 }
50}
51
52impl SettingWimax {
53 #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
63 #[allow(deprecated)]
64 #[doc(alias = "nm_setting_wimax_new")]
65 pub fn new() -> SettingWimax {
66 assert_initialized_main_thread!();
67 unsafe {
68 Setting::from_glib_full(ffi::nm_setting_wimax_new()).unsafe_cast()
69 }
70 }
71
72 pub fn builder() -> SettingWimaxBuilder {
77 SettingWimaxBuilder::new()
78 }
79
80
81 #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
92 #[allow(deprecated)]
93 #[doc(alias = "nm_setting_wimax_get_mac_address")]
94 #[doc(alias = "get_mac_address")]
95 #[doc(alias = "mac-address")]
96 pub fn mac_address(&self) -> glib::GString {
97 unsafe {
98 from_glib_none(ffi::nm_setting_wimax_get_mac_address(self.to_glib_none().0))
99 }
100 }
101
102 #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
113 #[allow(deprecated)]
114 #[doc(alias = "nm_setting_wimax_get_network_name")]
115 #[doc(alias = "get_network_name")]
116 #[doc(alias = "network-name")]
117 pub fn network_name(&self) -> glib::GString {
118 unsafe {
119 from_glib_none(ffi::nm_setting_wimax_get_network_name(self.to_glib_none().0))
120 }
121 }
122
123 #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
131 #[doc(alias = "mac-address")]
132 pub fn set_mac_address(&self, mac_address: Option<&str>) {
133 ObjectExt::set_property(self,"mac-address", mac_address)
134 }
135
136 #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
143 #[doc(alias = "network-name")]
144 pub fn set_network_name(&self, network_name: Option<&str>) {
145 ObjectExt::set_property(self,"network-name", network_name)
146 }
147
148 #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
149 #[doc(alias = "mac-address")]
150 pub fn connect_mac_address_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
151 unsafe extern "C" fn notify_mac_address_trampoline<F: Fn(&SettingWimax) + 'static>(this: *mut ffi::NMSettingWimax, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
152 let f: &F = &*(f as *const F);
153 f(&from_glib_borrow(this))
154 }
155 unsafe {
156 let f: Box_<F> = Box_::new(f);
157 connect_raw(self.as_ptr() as *mut _, c"notify::mac-address".as_ptr() as *const _,
158 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_mac_address_trampoline::<F> as *const ())), Box_::into_raw(f))
159 }
160 }
161
162 #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
163 #[doc(alias = "network-name")]
164 pub fn connect_network_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
165 unsafe extern "C" fn notify_network_name_trampoline<F: Fn(&SettingWimax) + 'static>(this: *mut ffi::NMSettingWimax, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
166 let f: &F = &*(f as *const F);
167 f(&from_glib_borrow(this))
168 }
169 unsafe {
170 let f: Box_<F> = Box_::new(f);
171 connect_raw(self.as_ptr() as *mut _, c"notify::network-name".as_ptr() as *const _,
172 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_network_name_trampoline::<F> as *const ())), Box_::into_raw(f))
173 }
174 }
175}
176
177impl Default for SettingWimax {
178 fn default() -> Self {
179 Self::new()
180 }
181 }
182
183#[must_use = "The builder must be built to be used"]
188pub struct SettingWimaxBuilder {
189 builder: glib::object::ObjectBuilder<'static, SettingWimax>,
190 }
191
192 impl SettingWimaxBuilder {
193 fn new() -> Self {
194 Self { builder: glib::object::Object::builder() }
195 }
196
197 #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
202 pub fn mac_address(self, mac_address: impl Into<glib::GString>) -> Self {
203 Self { builder: self.builder.property("mac-address", mac_address.into()), }
204 }
205
206 #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")]
210 pub fn network_name(self, network_name: impl Into<glib::GString>) -> Self {
211 Self { builder: self.builder.property("network-name", network_name.into()), }
212 }
213
214 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
217 pub fn build(self) -> SettingWimax {
218assert_initialized_main_thread!();
219 self.builder.build() }
220}