nm_rs/auto/
device_dummy.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#![allow(deprecated)]
6
7use crate::{ffi,Device,Object};
8use glib::{prelude::*};
9#[cfg(feature = "v1_10")]
10#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
11use glib::{translate::*};
12
13glib::wrapper! {
14    ///
15    ///
16    /// # Implements
17    ///
18    /// [`DeviceExt`][trait@crate::prelude::DeviceExt], [`ObjectExt`][trait@crate::prelude::ObjectExt]
19    #[doc(alias = "NMDeviceDummy")]
20    pub struct DeviceDummy(Object<ffi::NMDeviceDummy, ffi::NMDeviceDummyClass>) @extends Device, Object;
21
22    match fn {
23        type_ => || ffi::nm_device_dummy_get_type(),
24    }
25}
26
27impl DeviceDummy {
28            // rustdoc-stripper-ignore-next
29            /// Creates a new builder-pattern struct instance to construct [`DeviceDummy`] objects.
30            ///
31            /// This method returns an instance of [`DeviceDummyBuilder`](crate::builders::DeviceDummyBuilder) which can be used to create [`DeviceDummy`] objects.
32            pub fn builder() -> DeviceDummyBuilder {
33                DeviceDummyBuilder::new()
34            }
35        
36
37    /// Gets the hardware (MAC) address of the #NMDeviceDummy
38    ///
39    /// # Deprecated since 1.24
40    ///
41    /// Use nm_device_get_hw_address() instead.
42    ///
43    /// # Returns
44    ///
45    /// the hardware address. This is the internal string used by the
46    /// device, and must not be modified.
47    #[cfg_attr(feature = "v1_24", deprecated = "Since 1.24")]
48    #[cfg(feature = "v1_10")]
49    #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
50    #[allow(deprecated)]
51    #[doc(alias = "nm_device_dummy_get_hw_address")]
52    #[doc(alias = "get_hw_address")]
53    pub fn hw_address(&self) -> glib::GString {
54        unsafe {
55            from_glib_none(ffi::nm_device_dummy_get_hw_address(self.to_glib_none().0))
56        }
57    }
58}
59
60// rustdoc-stripper-ignore-next
61        /// A [builder-pattern] type to construct [`DeviceDummy`] objects.
62        ///
63        /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
64#[must_use = "The builder must be built to be used"]
65pub struct DeviceDummyBuilder {
66            builder: glib::object::ObjectBuilder<'static, DeviceDummy>,
67        }
68
69        impl DeviceDummyBuilder {
70        fn new() -> Self {
71            Self { builder: glib::object::Object::builder() }
72        }
73
74                            /// Whether the device can auto-activate a connection.
75                            ///
76                            /// The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
77                            pub fn autoconnect(self, autoconnect: bool) -> Self {
78                            Self { builder: self.builder.property("autoconnect", autoconnect), }
79                        }
80
81    // rustdoc-stripper-ignore-next
82    /// Build the [`DeviceDummy`].
83    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
84    pub fn build(self) -> DeviceDummy {
85assert_initialized_main_thread!();
86    self.builder.build() }
87}