nm_rs/auto/device6_lowpan.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
6use crate::{ffi,Device,Object};
7use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
8use std::{boxed::Box as Box_};
9
10glib::wrapper! {
11 ///
12 ///
13 /// ## Properties
14 ///
15 ///
16 /// #### `parent`
17 /// The devices's parent device.
18 ///
19 /// Readable
20 /// <details><summary><h4>Device</h4></summary>
21 ///
22 ///
23 /// #### `active-connection`
24 /// The #NMActiveConnection object that "owns" this device during activation.
25 ///
26 /// Readable
27 ///
28 ///
29 /// #### `autoconnect`
30 /// Whether the device can auto-activate a connection.
31 ///
32 /// The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
33 ///
34 /// Readable | Writeable
35 ///
36 ///
37 /// #### `available-connections`
38 /// The available connections of the device
39 ///
40 /// Readable
41 ///
42 ///
43 /// #### `capabilities`
44 /// The capabilities of the device.
45 ///
46 /// Readable
47 ///
48 ///
49 /// #### `device-type`
50 /// The numeric type of the device.
51 ///
52 /// Readable
53 ///
54 ///
55 /// #### `dhcp4-config`
56 /// The IPv4 #NMDhcpConfig of the device.
57 ///
58 /// Readable
59 ///
60 ///
61 /// #### `dhcp6-config`
62 /// The IPv6 #NMDhcpConfig of the device.
63 ///
64 /// Readable
65 ///
66 ///
67 /// #### `driver`
68 /// The driver of the device.
69 ///
70 /// Readable
71 ///
72 ///
73 /// #### `driver-version`
74 /// The version of the device driver.
75 ///
76 /// Readable
77 ///
78 ///
79 /// #### `firmware-missing`
80 /// When [`true`] indicates the device is likely missing firmware required
81 /// for its operation.
82 ///
83 /// Readable
84 ///
85 ///
86 /// #### `firmware-version`
87 /// The firmware version of the device.
88 ///
89 /// Readable
90 ///
91 ///
92 /// #### `hw-address`
93 /// The hardware address of the device.
94 ///
95 /// Readable
96 ///
97 ///
98 /// #### `interface`
99 /// The interface of the device.
100 ///
101 /// Readable
102 ///
103 ///
104 /// #### `interface-flags`
105 /// The interface flags.
106 ///
107 /// Readable
108 ///
109 ///
110 /// #### `ip-interface`
111 /// The IP interface of the device which should be used for all IP-related
112 /// operations like addressing and routing.
113 ///
114 /// Readable
115 ///
116 ///
117 /// #### `ip4-config`
118 /// The #NMIP4Config of the device.
119 ///
120 /// Readable
121 ///
122 ///
123 /// #### `ip4-connectivity`
124 /// The IPv4 connectivity state of the device.
125 ///
126 /// Readable
127 ///
128 ///
129 /// #### `ip6-config`
130 /// The IPv6 #NMIPConfig of the device.
131 ///
132 /// Readable
133 ///
134 ///
135 /// #### `ip6-connectivity`
136 /// The IPv6 connectivity state of the device.
137 ///
138 /// Readable
139 ///
140 ///
141 /// #### `lldp-neighbors`
142 /// The LLDP neighbors.
143 ///
144 /// Readable
145 ///
146 ///
147 /// #### `managed`
148 /// Whether the device is managed by NetworkManager.
149 ///
150 /// Readable
151 ///
152 ///
153 /// #### `metered`
154 /// Whether the device is metered.
155 ///
156 /// Readable
157 ///
158 ///
159 /// #### `mtu`
160 /// The MTU of the device.
161 ///
162 /// Readable
163 ///
164 ///
165 /// #### `nm-plugin-missing`
166 /// When [`true`] indicates that the NetworkManager plugin for the device
167 /// is not installed.
168 ///
169 /// Readable
170 ///
171 ///
172 /// #### `path`
173 /// The device path as exposed by the udev property ID_PATH.
174 ///
175 /// The string is backslash escaped (C escaping) for invalid
176 /// characters. The escaping can be reverted with g_strcompress(),
177 /// however the result may not be valid UTF-8.
178 ///
179 /// Readable
180 ///
181 ///
182 /// #### `physical-port-id`
183 /// The physical port ID of the device. (See
184 /// nm_device_get_physical_port_id().)
185 ///
186 /// Readable
187 ///
188 ///
189 /// #### `ports`
190 /// The port devices of the controller device. For devices that cannot be
191 /// controllers this is likely to be always empty.
192 ///
193 /// Readable
194 ///
195 ///
196 /// #### `product`
197 /// The product string of the device.
198 ///
199 /// Readable
200 ///
201 ///
202 /// #### `real`
203 /// Whether the device is real or is a placeholder device that could
204 /// be created automatically by NetworkManager if one of its
205 /// #NMDevice:available-connections was activated.
206 ///
207 /// Readable
208 ///
209 ///
210 /// #### `state`
211 /// The state of the device.
212 ///
213 /// Readable
214 ///
215 ///
216 /// #### `state-reason`
217 /// The reason for the device state.
218 ///
219 /// Readable
220 ///
221 ///
222 /// #### `udi`
223 /// An operating-system specific device hardware identifier; this is not
224 /// unique to a specific hardware device across reboots or hotplugs. It
225 /// is an opaque string which for some device types (Bluetooth, Modem)
226 /// contains an identifier provided by the underlying hardware service daemon
227 /// such as Bluez or ModemManager, and clients can use this property to
228 /// request more information about the device from those services.
229 ///
230 /// Readable
231 ///
232 ///
233 /// #### `vendor`
234 /// The vendor string of the device.
235 ///
236 /// Readable
237 /// </details>
238 /// <details><summary><h4>Object</h4></summary>
239 ///
240 ///
241 /// #### `client`
242 /// The NMClient instance as returned by nm_object_get_client().
243 ///
244 /// When an NMObject gets removed from the NMClient cache,
245 /// the NMObject:path property stays unchanged, but this client
246 /// instance gets reset to [`None`]. You can use this property to
247 /// track removal of the object from the cache.
248 ///
249 /// Readable
250 ///
251 ///
252 /// #### `path`
253 /// The D-Bus object path.
254 ///
255 /// The D-Bus path of an object instance never changes, even if the object
256 /// gets removed from the cache. To see whether the object is still in the
257 /// cache, check NMObject:client.
258 ///
259 /// Readable
260 /// </details>
261 ///
262 /// # Implements
263 ///
264 /// [`DeviceExt`][trait@crate::prelude::DeviceExt], [`ObjectExt`][trait@crate::prelude::ObjectExt]
265 #[doc(alias = "NMDevice6Lowpan")]
266 pub struct Device6Lowpan(Object<ffi::NMDevice6Lowpan, ffi::NMDevice6LowpanClass>) @extends Device, Object;
267
268 match fn {
269 type_ => || ffi::nm_device_6lowpan_get_type(),
270 }
271}
272
273impl Device6Lowpan {
274 // rustdoc-stripper-ignore-next
275 /// Creates a new builder-pattern struct instance to construct [`Device6Lowpan`] objects.
276 ///
277 /// This method returns an instance of [`Device6LowpanBuilder`](crate::builders::Device6LowpanBuilder) which can be used to create [`Device6Lowpan`] objects.
278 pub fn builder() -> Device6LowpanBuilder {
279 Device6LowpanBuilder::new()
280 }
281
282
283 ///
284 /// # Returns
285 ///
286 /// the device's parent device
287 #[cfg(feature = "v1_42")]
288 #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
289 #[doc(alias = "nm_device_6lowpan_get_parent")]
290 #[doc(alias = "get_parent")]
291 pub fn parent(&self) -> Device {
292 unsafe {
293 from_glib_none(ffi::nm_device_6lowpan_get_parent(self.to_glib_none().0))
294 }
295 }
296
297 #[cfg(not(feature = "v1_42"))]
298 #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_42"))))]
299 pub fn parent(&self) -> Option<Device> {
300 ObjectExt::property(self, "parent")
301 }
302
303 #[cfg(feature = "v1_14")]
304 #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
305 #[doc(alias = "parent")]
306 pub fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
307 unsafe extern "C" fn notify_parent_trampoline<F: Fn(&Device6Lowpan) + 'static>(this: *mut ffi::NMDevice6Lowpan, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
308 let f: &F = &*(f as *const F);
309 f(&from_glib_borrow(this))
310 }
311 unsafe {
312 let f: Box_<F> = Box_::new(f);
313 connect_raw(self.as_ptr() as *mut _, c"notify::parent".as_ptr() as *const _,
314 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_parent_trampoline::<F> as *const ())), Box_::into_raw(f))
315 }
316 }
317}
318
319// rustdoc-stripper-ignore-next
320 /// A [builder-pattern] type to construct [`Device6Lowpan`] objects.
321 ///
322 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
323#[must_use = "The builder must be built to be used"]
324pub struct Device6LowpanBuilder {
325 builder: glib::object::ObjectBuilder<'static, Device6Lowpan>,
326 }
327
328 impl Device6LowpanBuilder {
329 fn new() -> Self {
330 Self { builder: glib::object::Object::builder() }
331 }
332
333 /// Whether the device can auto-activate a connection.
334 ///
335 /// The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
336 pub fn autoconnect(self, autoconnect: bool) -> Self {
337 Self { builder: self.builder.property("autoconnect", autoconnect), }
338 }
339
340 // rustdoc-stripper-ignore-next
341 /// Build the [`Device6Lowpan`].
342 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
343 pub fn build(self) -> Device6Lowpan {
344assert_initialized_main_thread!();
345 self.builder.build() }
346}