nm-rs 0.1.3

Rust bindings for the libnm library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir
// from gtk-girs (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::{ffi,Setting};
use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
use std::{boxed::Box as Box_};

glib::wrapper! {
    /// Match settings
    ///
    /// ## Properties
    ///
    ///
    /// #### `driver`
    ///  A list of driver names to match. Each element is a shell wildcard pattern.
    ///
    /// See NMSettingMatch:interface-name for how special characters '|', '&',
    /// '!' and '\\' are used for optional and mandatory matches and inverting the
    /// pattern.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `interface-name`
    ///  A list of interface names to match. Each element is a shell wildcard
    /// pattern.
    ///
    /// An element can be prefixed with a pipe symbol (|) or an ampersand (&).
    /// The former means that the element is optional and the latter means that
    /// it is mandatory. If there are any optional elements, than the match
    /// evaluates to true if at least one of the optional element matches
    /// (logical OR). If there are any mandatory elements, then they all
    /// must match (logical AND). By default, an element is optional. This means
    /// that an element "foo" behaves the same as "|foo". An element can also be inverted
    /// with exclamation mark (!) between the pipe symbol (or the ampersand) and before
    /// the pattern. Note that "!foo" is a shortcut for the mandatory match "&!foo". Finally,
    /// a backslash can be used at the beginning of the element (after the optional special characters)
    /// to escape the start of the pattern. For example, "&\\!a" is an mandatory match for literally "!a".
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `kernel-command-line`
    ///  A list of kernel command line arguments to match. This may be used to check
    /// whether a specific kernel command line option is set (or unset, if prefixed with
    /// the exclamation mark). The argument must either be a single word, or
    /// an assignment (i.e. two words, joined by "="). In the former case the kernel
    /// command line is searched for the word appearing as is, or as left hand side
    /// of an assignment. In the latter case, the exact assignment is looked for
    /// with right and left hand side matching. Wildcard patterns are not supported.
    ///
    /// See NMSettingMatch:interface-name for how special characters '|', '&',
    /// '!' and '\\' are used for optional and mandatory matches and inverting the
    /// match.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `path`
    ///  A list of paths to match against the ID_PATH udev property of
    /// devices. ID_PATH represents the topological persistent path of a
    /// device. It typically contains a subsystem string (pci, usb, platform,
    /// etc.) and a subsystem-specific identifier.
    ///
    /// For PCI devices the path has the form
    /// "pci-$domain:$bus:$device.$function", where each variable is an
    /// hexadecimal value; for example "pci-0000:0a:00.0".
    ///
    /// The path of a device can be obtained with "udevadm info
    /// /sys/class/net/$dev | grep ID_PATH=" or by looking at the "path"
    /// property exported by NetworkManager ("nmcli -f general.path device
    /// show $dev").
    ///
    /// Each element of the list is a shell wildcard pattern.
    ///
    /// See NMSettingMatch:interface-name for how special characters '|', '&',
    /// '!' and '\\' are used for optional and mandatory matches and inverting the
    /// pattern.
    ///
    /// Readable | Writeable
    /// <details><summary><h4>Setting</h4></summary>
    ///
    ///
    /// #### `name`
    ///  The setting's name, which uniquely identifies the setting within the
    /// connection.  Each setting type has a name unique to that type, for
    /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
    ///
    /// Readable
    /// </details>
    ///
    /// # Implements
    ///
    /// [`SettingExt`][trait@crate::prelude::SettingExt]
    #[doc(alias = "NMSettingMatch")]
    pub struct SettingMatch(Object<ffi::NMSettingMatch, ffi::NMSettingMatchClass>) @extends Setting;

    match fn {
        type_ => || ffi::nm_setting_match_get_type(),
    }
}

impl SettingMatch {
    /// Creates a new #NMSettingMatch object with default values.
    ///
    /// # Returns
    ///
    /// the new empty #NMSettingMatch object
    ///
    /// Note that this function was present in header files since version 1.14.
    /// But due to a bug the symbol is only exposed and usable since version 1.32.
    /// As workaround, use g_object_new(NM_TYPE_SETTING_MATCH) which works with all
    /// versions since 1.14.
    #[cfg(feature = "v1_32")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_32")))]
    #[doc(alias = "nm_setting_match_new")]
    pub fn new() -> SettingMatch {
        assert_initialized_main_thread!();
        unsafe {
            Setting::from_glib_full(ffi::nm_setting_match_new()).unsafe_cast()
        }
    }

            // rustdoc-stripper-ignore-next
            /// Creates a new builder-pattern struct instance to construct [`SettingMatch`] objects.
            ///
            /// This method returns an instance of [`SettingMatchBuilder`](crate::builders::SettingMatchBuilder) which can be used to create [`SettingMatch`] objects.
            pub fn builder() -> SettingMatchBuilder {
                SettingMatchBuilder::new()
            }
        

    /// Adds a new driver to the setting.
    /// ## `driver`
    /// the driver to add
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_add_driver")]
    pub fn add_driver(&self, driver: &str) {
        unsafe {
            ffi::nm_setting_match_add_driver(self.to_glib_none().0, driver.to_glib_none().0);
        }
    }

    /// Adds a new interface name to the setting.
    /// ## `interface_name`
    /// the interface name to add
    #[doc(alias = "nm_setting_match_add_interface_name")]
    pub fn add_interface_name(&self, interface_name: &str) {
        unsafe {
            ffi::nm_setting_match_add_interface_name(self.to_glib_none().0, interface_name.to_glib_none().0);
        }
    }

    /// Adds a new kernel command line argument to the setting.
    /// ## `kernel_command_line`
    /// the kernel command line argument to add
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_add_kernel_command_line")]
    pub fn add_kernel_command_line(&self, kernel_command_line: &str) {
        unsafe {
            ffi::nm_setting_match_add_kernel_command_line(self.to_glib_none().0, kernel_command_line.to_glib_none().0);
        }
    }

    /// Adds a new path to the setting.
    /// ## `path`
    /// the path to add
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_add_path")]
    pub fn add_path(&self, path: &str) {
        unsafe {
            ffi::nm_setting_match_add_path(self.to_glib_none().0, path.to_glib_none().0);
        }
    }

    /// Removes all configured drivers.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_clear_drivers")]
    pub fn clear_drivers(&self) {
        unsafe {
            ffi::nm_setting_match_clear_drivers(self.to_glib_none().0);
        }
    }

    /// Removes all configured interface names.
    #[doc(alias = "nm_setting_match_clear_interface_names")]
    pub fn clear_interface_names(&self) {
        unsafe {
            ffi::nm_setting_match_clear_interface_names(self.to_glib_none().0);
        }
    }

    /// Removes all configured kernel command line arguments.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_clear_kernel_command_lines")]
    pub fn clear_kernel_command_lines(&self) {
        unsafe {
            ffi::nm_setting_match_clear_kernel_command_lines(self.to_glib_none().0);
        }
    }

    /// Removes all configured paths.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_clear_paths")]
    pub fn clear_paths(&self) {
        unsafe {
            ffi::nm_setting_match_clear_paths(self.to_glib_none().0);
        }
    }

    /// Since 1.46, access at index "len" is allowed and returns NULL.
    /// ## `idx`
    /// index number of the driver to return
    ///
    /// # Returns
    ///
    /// the driver at index @idx
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_get_driver")]
    #[doc(alias = "get_driver")]
    pub fn driver(&self, idx: u32) -> glib::GString {
        unsafe {
            from_glib_none(ffi::nm_setting_match_get_driver(self.to_glib_none().0, idx))
        }
    }

    /// Returns all the drivers.
    ///
    /// # Returns
    ///
    /// the configured drivers.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_get_drivers")]
    #[doc(alias = "get_drivers")]
    pub fn drivers(&self) -> Vec<glib::GString> {
        unsafe {
            let mut length = std::mem::MaybeUninit::uninit();
            let ret = FromGlibContainer::from_glib_none_num(ffi::nm_setting_match_get_drivers(self.to_glib_none().0, length.as_mut_ptr()), length.assume_init() as _);
            ret
        }
    }

    /// Since 1.46, access at index "len" is allowed and returns NULL.
    /// ## `idx`
    /// index number of the DNS search domain to return
    ///
    /// # Returns
    ///
    /// the interface name at index @idx
    #[doc(alias = "nm_setting_match_get_interface_name")]
    #[doc(alias = "get_interface_name")]
    #[doc(alias = "interface-name")]
    pub fn interface_name(&self, idx: i32) -> glib::GString {
        unsafe {
            from_glib_none(ffi::nm_setting_match_get_interface_name(self.to_glib_none().0, idx))
        }
    }

    /// Returns all the interface names.
    ///
    /// # Returns
    ///
    /// the NULL terminated list of
    ///   configured interface names.
    ///
    /// Before 1.26, the returned array was not [`None`] terminated and you MUST provide a length.
    #[doc(alias = "nm_setting_match_get_interface_names")]
    #[doc(alias = "get_interface_names")]
    pub fn interface_names(&self) -> Vec<glib::GString> {
        unsafe {
            let mut length = std::mem::MaybeUninit::uninit();
            let ret = FromGlibContainer::from_glib_none_num(ffi::nm_setting_match_get_interface_names(self.to_glib_none().0, length.as_mut_ptr()), length.assume_init() as _);
            ret
        }
    }

    /// Since 1.46, access at index "len" is allowed and returns NULL.
    /// ## `idx`
    /// index number of the kernel command line argument to return
    ///
    /// # Returns
    ///
    /// the kernel command line argument at index @idx
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_get_kernel_command_line")]
    #[doc(alias = "get_kernel_command_line")]
    #[doc(alias = "kernel-command-line")]
    pub fn kernel_command_line(&self, idx: u32) -> glib::GString {
        unsafe {
            from_glib_none(ffi::nm_setting_match_get_kernel_command_line(self.to_glib_none().0, idx))
        }
    }

    /// Returns all the kernel command line arguments.
    ///
    /// # Returns
    ///
    /// the configured kernel command
    ///    line arguments.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_get_kernel_command_lines")]
    #[doc(alias = "get_kernel_command_lines")]
    pub fn kernel_command_lines(&self) -> Vec<glib::GString> {
        unsafe {
            let mut length = std::mem::MaybeUninit::uninit();
            let ret = FromGlibContainer::from_glib_none_num(ffi::nm_setting_match_get_kernel_command_lines(self.to_glib_none().0, length.as_mut_ptr()), length.assume_init() as _);
            ret
        }
    }

    ///
    /// # Returns
    ///
    /// the number of configured drivers
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_get_num_drivers")]
    #[doc(alias = "get_num_drivers")]
    pub fn num_drivers(&self) -> u32 {
        unsafe {
            ffi::nm_setting_match_get_num_drivers(self.to_glib_none().0)
        }
    }

    ///
    /// # Returns
    ///
    /// the number of configured interface names
    #[doc(alias = "nm_setting_match_get_num_interface_names")]
    #[doc(alias = "get_num_interface_names")]
    pub fn num_interface_names(&self) -> u32 {
        unsafe {
            ffi::nm_setting_match_get_num_interface_names(self.to_glib_none().0)
        }
    }

    ///
    /// # Returns
    ///
    /// the number of configured kernel command line arguments
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_get_num_kernel_command_lines")]
    #[doc(alias = "get_num_kernel_command_lines")]
    pub fn num_kernel_command_lines(&self) -> u32 {
        unsafe {
            ffi::nm_setting_match_get_num_kernel_command_lines(self.to_glib_none().0)
        }
    }

    ///
    /// # Returns
    ///
    /// the number of configured paths
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_get_num_paths")]
    #[doc(alias = "get_num_paths")]
    pub fn num_paths(&self) -> u32 {
        unsafe {
            ffi::nm_setting_match_get_num_paths(self.to_glib_none().0)
        }
    }

    /// Since 1.46, access at index "len" is allowed and returns NULL.
    /// ## `idx`
    /// index number of the path to return
    ///
    /// # Returns
    ///
    /// the path at index @idx
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_get_path")]
    #[doc(alias = "get_path")]
    pub fn path(&self, idx: u32) -> glib::GString {
        unsafe {
            from_glib_none(ffi::nm_setting_match_get_path(self.to_glib_none().0, idx))
        }
    }

    /// Returns all the paths.
    ///
    /// # Returns
    ///
    /// the configured paths.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_get_paths")]
    #[doc(alias = "get_paths")]
    pub fn paths(&self) -> Vec<glib::GString> {
        unsafe {
            let mut length = std::mem::MaybeUninit::uninit();
            let ret = FromGlibContainer::from_glib_none_num(ffi::nm_setting_match_get_paths(self.to_glib_none().0, length.as_mut_ptr()), length.assume_init() as _);
            ret
        }
    }

    /// Removes the driver at index @idx.
    /// ## `idx`
    /// index number of the driver
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_remove_driver")]
    pub fn remove_driver(&self, idx: u32) {
        unsafe {
            ffi::nm_setting_match_remove_driver(self.to_glib_none().0, idx);
        }
    }

    /// Removes @driver.
    /// ## `driver`
    /// the driver to remove
    ///
    /// # Returns
    ///
    /// [`true`] if the driver was found and removed; [`false`] if it was not.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_remove_driver_by_value")]
    pub fn remove_driver_by_value(&self, driver: &str) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_match_remove_driver_by_value(self.to_glib_none().0, driver.to_glib_none().0))
        }
    }

    /// Removes the interface name at index @idx.
    /// ## `idx`
    /// index number of the interface name
    #[doc(alias = "nm_setting_match_remove_interface_name")]
    pub fn remove_interface_name(&self, idx: i32) {
        unsafe {
            ffi::nm_setting_match_remove_interface_name(self.to_glib_none().0, idx);
        }
    }

    /// Removes @interface_name.
    /// ## `interface_name`
    /// the interface name to remove
    ///
    /// # Returns
    ///
    /// [`true`] if the interface name was found and removed; [`false`] if it was not.
    #[doc(alias = "nm_setting_match_remove_interface_name_by_value")]
    pub fn remove_interface_name_by_value(&self, interface_name: &str) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_match_remove_interface_name_by_value(self.to_glib_none().0, interface_name.to_glib_none().0))
        }
    }

    /// Removes the kernel command line argument at index @idx.
    /// ## `idx`
    /// index number of the kernel command line argument
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_remove_kernel_command_line")]
    pub fn remove_kernel_command_line(&self, idx: u32) {
        unsafe {
            ffi::nm_setting_match_remove_kernel_command_line(self.to_glib_none().0, idx);
        }
    }

    /// Removes @kernel_command_line.
    /// ## `kernel_command_line`
    /// the kernel command line argument name to remove
    ///
    /// # Returns
    ///
    /// [`true`] if the kernel command line argument was found and removed; [`false`] if it was not.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_remove_kernel_command_line_by_value")]
    pub fn remove_kernel_command_line_by_value(&self, kernel_command_line: &str) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_match_remove_kernel_command_line_by_value(self.to_glib_none().0, kernel_command_line.to_glib_none().0))
        }
    }

    /// Removes the path at index @idx.
    /// ## `idx`
    /// index number of the path
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_remove_path")]
    pub fn remove_path(&self, idx: u32) {
        unsafe {
            ffi::nm_setting_match_remove_path(self.to_glib_none().0, idx);
        }
    }

    /// Removes @path.
    /// ## `path`
    /// the path to remove
    ///
    /// # Returns
    ///
    /// [`true`] if the path was found and removed; [`false`] if it was not.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_match_remove_path_by_value")]
    pub fn remove_path_by_value(&self, path: &str) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_match_remove_path_by_value(self.to_glib_none().0, path.to_glib_none().0))
        }
    }

    /// A list of driver names to match. Each element is a shell wildcard pattern.
    ///
    /// See NMSettingMatch:interface-name for how special characters '|', '&',
    /// '!' and '\\' are used for optional and mandatory matches and inverting the
    /// pattern.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    pub fn set_driver(&self, driver: &[&str]) {
        ObjectExt::set_property(self,"driver", driver)
    }

    /// A list of interface names to match. Each element is a shell wildcard
    /// pattern.
    ///
    /// An element can be prefixed with a pipe symbol (|) or an ampersand (&).
    /// The former means that the element is optional and the latter means that
    /// it is mandatory. If there are any optional elements, than the match
    /// evaluates to true if at least one of the optional element matches
    /// (logical OR). If there are any mandatory elements, then they all
    /// must match (logical AND). By default, an element is optional. This means
    /// that an element "foo" behaves the same as "|foo". An element can also be inverted
    /// with exclamation mark (!) between the pipe symbol (or the ampersand) and before
    /// the pattern. Note that "!foo" is a shortcut for the mandatory match "&!foo". Finally,
    /// a backslash can be used at the beginning of the element (after the optional special characters)
    /// to escape the start of the pattern. For example, "&\\!a" is an mandatory match for literally "!a".
    #[cfg(feature = "v1_14")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
    #[doc(alias = "interface-name")]
    pub fn set_interface_name(&self, interface_name: &[&str]) {
        ObjectExt::set_property(self,"interface-name", interface_name)
    }

    /// A list of kernel command line arguments to match. This may be used to check
    /// whether a specific kernel command line option is set (or unset, if prefixed with
    /// the exclamation mark). The argument must either be a single word, or
    /// an assignment (i.e. two words, joined by "="). In the former case the kernel
    /// command line is searched for the word appearing as is, or as left hand side
    /// of an assignment. In the latter case, the exact assignment is looked for
    /// with right and left hand side matching. Wildcard patterns are not supported.
    ///
    /// See NMSettingMatch:interface-name for how special characters '|', '&',
    /// '!' and '\\' are used for optional and mandatory matches and inverting the
    /// match.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "kernel-command-line")]
    pub fn set_kernel_command_line(&self, kernel_command_line: &[&str]) {
        ObjectExt::set_property(self,"kernel-command-line", kernel_command_line)
    }

    /// A list of paths to match against the ID_PATH udev property of
    /// devices. ID_PATH represents the topological persistent path of a
    /// device. It typically contains a subsystem string (pci, usb, platform,
    /// etc.) and a subsystem-specific identifier.
    ///
    /// For PCI devices the path has the form
    /// "pci-$domain:$bus:$device.$function", where each variable is an
    /// hexadecimal value; for example "pci-0000:0a:00.0".
    ///
    /// The path of a device can be obtained with "udevadm info
    /// /sys/class/net/$dev | grep ID_PATH=" or by looking at the "path"
    /// property exported by NetworkManager ("nmcli -f general.path device
    /// show $dev").
    ///
    /// Each element of the list is a shell wildcard pattern.
    ///
    /// See NMSettingMatch:interface-name for how special characters '|', '&',
    /// '!' and '\\' are used for optional and mandatory matches and inverting the
    /// pattern.
    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    pub fn set_path(&self, path: &[&str]) {
        ObjectExt::set_property(self,"path", path)
    }

    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "driver")]
    pub fn connect_driver_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_driver_trampoline<F: Fn(&SettingMatch) + 'static>(this: *mut ffi::NMSettingMatch, _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::driver".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_driver_trampoline::<F> as *const ())), Box_::into_raw(f))
        }
    }

    #[cfg(feature = "v1_14")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
    #[doc(alias = "interface-name")]
    pub fn connect_interface_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_interface_name_trampoline<F: Fn(&SettingMatch) + 'static>(this: *mut ffi::NMSettingMatch, _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::interface-name".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_interface_name_trampoline::<F> as *const ())), Box_::into_raw(f))
        }
    }

    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "kernel-command-line")]
    pub fn connect_kernel_command_line_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_kernel_command_line_trampoline<F: Fn(&SettingMatch) + 'static>(this: *mut ffi::NMSettingMatch, _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::kernel-command-line".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_kernel_command_line_trampoline::<F> as *const ())), Box_::into_raw(f))
        }
    }

    #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    #[doc(alias = "path")]
    pub fn connect_path_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_path_trampoline<F: Fn(&SettingMatch) + 'static>(this: *mut ffi::NMSettingMatch, _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::path".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_path_trampoline::<F> as *const ())), Box_::into_raw(f))
        }
    }
}

#[cfg(feature = "v1_32")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_32")))]
impl Default for SettingMatch {
                     fn default() -> Self {
                         Self::new()
                     }
                 }

// rustdoc-stripper-ignore-next
        /// A [builder-pattern] type to construct [`SettingMatch`] objects.
        ///
        /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
#[must_use = "The builder must be built to be used"]
pub struct SettingMatchBuilder {
            builder: glib::object::ObjectBuilder<'static, SettingMatch>,
        }

        impl SettingMatchBuilder {
        fn new() -> Self {
            Self { builder: glib::object::Object::builder() }
        }

                            /// A list of driver names to match. Each element is a shell wildcard pattern.
                            ///
                            /// See NMSettingMatch:interface-name for how special characters '|', '&',
                            /// '!' and '\\' are used for optional and mandatory matches and inverting the
                            /// pattern.
                            #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    pub fn driver(self, driver: impl Into<glib::StrV>) -> Self {
                            Self { builder: self.builder.property("driver", driver.into()), }
                        }

                            /// A list of interface names to match. Each element is a shell wildcard
                            /// pattern.
                            ///
                            /// An element can be prefixed with a pipe symbol (|) or an ampersand (&).
                            /// The former means that the element is optional and the latter means that
                            /// it is mandatory. If there are any optional elements, than the match
                            /// evaluates to true if at least one of the optional element matches
                            /// (logical OR). If there are any mandatory elements, then they all
                            /// must match (logical AND). By default, an element is optional. This means
                            /// that an element "foo" behaves the same as "|foo". An element can also be inverted
                            /// with exclamation mark (!) between the pipe symbol (or the ampersand) and before
                            /// the pattern. Note that "!foo" is a shortcut for the mandatory match "&!foo". Finally,
                            /// a backslash can be used at the beginning of the element (after the optional special characters)
                            /// to escape the start of the pattern. For example, "&\\!a" is an mandatory match for literally "!a".
                            #[cfg(feature = "v1_14")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
    pub fn interface_name(self, interface_name: impl Into<glib::StrV>) -> Self {
                            Self { builder: self.builder.property("interface-name", interface_name.into()), }
                        }

                            /// A list of kernel command line arguments to match. This may be used to check
                            /// whether a specific kernel command line option is set (or unset, if prefixed with
                            /// the exclamation mark). The argument must either be a single word, or
                            /// an assignment (i.e. two words, joined by "="). In the former case the kernel
                            /// command line is searched for the word appearing as is, or as left hand side
                            /// of an assignment. In the latter case, the exact assignment is looked for
                            /// with right and left hand side matching. Wildcard patterns are not supported.
                            ///
                            /// See NMSettingMatch:interface-name for how special characters '|', '&',
                            /// '!' and '\\' are used for optional and mandatory matches and inverting the
                            /// match.
                            #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    pub fn kernel_command_line(self, kernel_command_line: impl Into<glib::StrV>) -> Self {
                            Self { builder: self.builder.property("kernel-command-line", kernel_command_line.into()), }
                        }

                            /// A list of paths to match against the ID_PATH udev property of
                            /// devices. ID_PATH represents the topological persistent path of a
                            /// device. It typically contains a subsystem string (pci, usb, platform,
                            /// etc.) and a subsystem-specific identifier.
                            ///
                            /// For PCI devices the path has the form
                            /// "pci-$domain:$bus:$device.$function", where each variable is an
                            /// hexadecimal value; for example "pci-0000:0a:00.0".
                            ///
                            /// The path of a device can be obtained with "udevadm info
                            /// /sys/class/net/$dev | grep ID_PATH=" or by looking at the "path"
                            /// property exported by NetworkManager ("nmcli -f general.path device
                            /// show $dev").
                            ///
                            /// Each element of the list is a shell wildcard pattern.
                            ///
                            /// See NMSettingMatch:interface-name for how special characters '|', '&',
                            /// '!' and '\\' are used for optional and mandatory matches and inverting the
                            /// pattern.
                            #[cfg(feature = "v1_26")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
    pub fn path(self, path: impl Into<glib::StrV>) -> Self {
                            Self { builder: self.builder.property("path", path.into()), }
                        }

    // rustdoc-stripper-ignore-next
    /// Build the [`SettingMatch`].
    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
    pub fn build(self) -> SettingMatch {
assert_initialized_main_thread!();
    self.builder.build() }
}