nm_rs/auto/
device_loopback.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::*};
8
9glib::wrapper! {
10    ///
11    ///
12    /// # Implements
13    ///
14    /// [`DeviceExt`][trait@crate::prelude::DeviceExt], [`ObjectExt`][trait@crate::prelude::ObjectExt]
15    #[doc(alias = "NMDeviceLoopback")]
16    pub struct DeviceLoopback(Object<ffi::NMDeviceLoopback, ffi::NMDeviceLoopbackClass>) @extends Device, Object;
17
18    match fn {
19        type_ => || ffi::nm_device_loopback_get_type(),
20    }
21}
22
23impl DeviceLoopback {
24            // rustdoc-stripper-ignore-next
25            /// Creates a new builder-pattern struct instance to construct [`DeviceLoopback`] objects.
26            ///
27            /// This method returns an instance of [`DeviceLoopbackBuilder`](crate::builders::DeviceLoopbackBuilder) which can be used to create [`DeviceLoopback`] objects.
28            pub fn builder() -> DeviceLoopbackBuilder {
29                DeviceLoopbackBuilder::new()
30            }
31        
32}
33
34// rustdoc-stripper-ignore-next
35        /// A [builder-pattern] type to construct [`DeviceLoopback`] objects.
36        ///
37        /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
38#[must_use = "The builder must be built to be used"]
39pub struct DeviceLoopbackBuilder {
40            builder: glib::object::ObjectBuilder<'static, DeviceLoopback>,
41        }
42
43        impl DeviceLoopbackBuilder {
44        fn new() -> Self {
45            Self { builder: glib::object::Object::builder() }
46        }
47
48                            /// Whether the device can auto-activate a connection.
49                            ///
50                            /// The property setter is a synchronous D-Bus call. This is deprecated since 1.22.
51                            pub fn autoconnect(self, autoconnect: bool) -> Self {
52                            Self { builder: self.builder.property("autoconnect", autoconnect), }
53                        }
54
55    // rustdoc-stripper-ignore-next
56    /// Build the [`DeviceLoopback`].
57    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
58    pub fn build(self) -> DeviceLoopback {
59assert_initialized_main_thread!();
60    self.builder.build() }
61}