nm_rs/auto/
setting_match.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,Setting};
7use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
8use std::{boxed::Box as Box_};
9
10glib::wrapper! {
11    /// Match settings
12    ///
13    /// ## Properties
14    ///
15    ///
16    /// #### `driver`
17    ///  A list of driver names to match. Each element is a shell wildcard pattern.
18    ///
19    /// See NMSettingMatch:interface-name for how special characters '|', '&',
20    /// '!' and '\\' are used for optional and mandatory matches and inverting the
21    /// pattern.
22    ///
23    /// Readable | Writeable
24    ///
25    ///
26    /// #### `interface-name`
27    ///  A list of interface names to match. Each element is a shell wildcard
28    /// pattern.
29    ///
30    /// An element can be prefixed with a pipe symbol (|) or an ampersand (&).
31    /// The former means that the element is optional and the latter means that
32    /// it is mandatory. If there are any optional elements, than the match
33    /// evaluates to true if at least one of the optional element matches
34    /// (logical OR). If there are any mandatory elements, then they all
35    /// must match (logical AND). By default, an element is optional. This means
36    /// that an element "foo" behaves the same as "|foo". An element can also be inverted
37    /// with exclamation mark (!) between the pipe symbol (or the ampersand) and before
38    /// the pattern. Note that "!foo" is a shortcut for the mandatory match "&!foo". Finally,
39    /// a backslash can be used at the beginning of the element (after the optional special characters)
40    /// to escape the start of the pattern. For example, "&\\!a" is an mandatory match for literally "!a".
41    ///
42    /// Readable | Writeable
43    ///
44    ///
45    /// #### `kernel-command-line`
46    ///  A list of kernel command line arguments to match. This may be used to check
47    /// whether a specific kernel command line option is set (or unset, if prefixed with
48    /// the exclamation mark). The argument must either be a single word, or
49    /// an assignment (i.e. two words, joined by "="). In the former case the kernel
50    /// command line is searched for the word appearing as is, or as left hand side
51    /// of an assignment. In the latter case, the exact assignment is looked for
52    /// with right and left hand side matching. Wildcard patterns are not supported.
53    ///
54    /// See NMSettingMatch:interface-name for how special characters '|', '&',
55    /// '!' and '\\' are used for optional and mandatory matches and inverting the
56    /// match.
57    ///
58    /// Readable | Writeable
59    ///
60    ///
61    /// #### `path`
62    ///  A list of paths to match against the ID_PATH udev property of
63    /// devices. ID_PATH represents the topological persistent path of a
64    /// device. It typically contains a subsystem string (pci, usb, platform,
65    /// etc.) and a subsystem-specific identifier.
66    ///
67    /// For PCI devices the path has the form
68    /// "pci-$domain:$bus:$device.$function", where each variable is an
69    /// hexadecimal value; for example "pci-0000:0a:00.0".
70    ///
71    /// The path of a device can be obtained with "udevadm info
72    /// /sys/class/net/$dev | grep ID_PATH=" or by looking at the "path"
73    /// property exported by NetworkManager ("nmcli -f general.path device
74    /// show $dev").
75    ///
76    /// Each element of the list is a shell wildcard pattern.
77    ///
78    /// See NMSettingMatch:interface-name for how special characters '|', '&',
79    /// '!' and '\\' are used for optional and mandatory matches and inverting the
80    /// pattern.
81    ///
82    /// Readable | Writeable
83    /// <details><summary><h4>Setting</h4></summary>
84    ///
85    ///
86    /// #### `name`
87    ///  The setting's name, which uniquely identifies the setting within the
88    /// connection.  Each setting type has a name unique to that type, for
89    /// example "ppp" or "802-11-wireless" or "802-3-ethernet".
90    ///
91    /// Readable
92    /// </details>
93    ///
94    /// # Implements
95    ///
96    /// [`SettingExt`][trait@crate::prelude::SettingExt]
97    #[doc(alias = "NMSettingMatch")]
98    pub struct SettingMatch(Object<ffi::NMSettingMatch, ffi::NMSettingMatchClass>) @extends Setting;
99
100    match fn {
101        type_ => || ffi::nm_setting_match_get_type(),
102    }
103}
104
105impl SettingMatch {
106    /// Creates a new #NMSettingMatch object with default values.
107    ///
108    /// # Returns
109    ///
110    /// the new empty #NMSettingMatch object
111    ///
112    /// Note that this function was present in header files since version 1.14.
113    /// But due to a bug the symbol is only exposed and usable since version 1.32.
114    /// As workaround, use g_object_new(NM_TYPE_SETTING_MATCH) which works with all
115    /// versions since 1.14.
116    #[cfg(feature = "v1_32")]
117    #[cfg_attr(docsrs, doc(cfg(feature = "v1_32")))]
118    #[doc(alias = "nm_setting_match_new")]
119    pub fn new() -> SettingMatch {
120        assert_initialized_main_thread!();
121        unsafe {
122            Setting::from_glib_full(ffi::nm_setting_match_new()).unsafe_cast()
123        }
124    }
125
126            // rustdoc-stripper-ignore-next
127            /// Creates a new builder-pattern struct instance to construct [`SettingMatch`] objects.
128            ///
129            /// This method returns an instance of [`SettingMatchBuilder`](crate::builders::SettingMatchBuilder) which can be used to create [`SettingMatch`] objects.
130            pub fn builder() -> SettingMatchBuilder {
131                SettingMatchBuilder::new()
132            }
133        
134
135    /// Adds a new driver to the setting.
136    /// ## `driver`
137    /// the driver to add
138    #[cfg(feature = "v1_26")]
139    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
140    #[doc(alias = "nm_setting_match_add_driver")]
141    pub fn add_driver(&self, driver: &str) {
142        unsafe {
143            ffi::nm_setting_match_add_driver(self.to_glib_none().0, driver.to_glib_none().0);
144        }
145    }
146
147    /// Adds a new interface name to the setting.
148    /// ## `interface_name`
149    /// the interface name to add
150    #[doc(alias = "nm_setting_match_add_interface_name")]
151    pub fn add_interface_name(&self, interface_name: &str) {
152        unsafe {
153            ffi::nm_setting_match_add_interface_name(self.to_glib_none().0, interface_name.to_glib_none().0);
154        }
155    }
156
157    /// Adds a new kernel command line argument to the setting.
158    /// ## `kernel_command_line`
159    /// the kernel command line argument to add
160    #[cfg(feature = "v1_26")]
161    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
162    #[doc(alias = "nm_setting_match_add_kernel_command_line")]
163    pub fn add_kernel_command_line(&self, kernel_command_line: &str) {
164        unsafe {
165            ffi::nm_setting_match_add_kernel_command_line(self.to_glib_none().0, kernel_command_line.to_glib_none().0);
166        }
167    }
168
169    /// Adds a new path to the setting.
170    /// ## `path`
171    /// the path to add
172    #[cfg(feature = "v1_26")]
173    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
174    #[doc(alias = "nm_setting_match_add_path")]
175    pub fn add_path(&self, path: &str) {
176        unsafe {
177            ffi::nm_setting_match_add_path(self.to_glib_none().0, path.to_glib_none().0);
178        }
179    }
180
181    /// Removes all configured drivers.
182    #[cfg(feature = "v1_26")]
183    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
184    #[doc(alias = "nm_setting_match_clear_drivers")]
185    pub fn clear_drivers(&self) {
186        unsafe {
187            ffi::nm_setting_match_clear_drivers(self.to_glib_none().0);
188        }
189    }
190
191    /// Removes all configured interface names.
192    #[doc(alias = "nm_setting_match_clear_interface_names")]
193    pub fn clear_interface_names(&self) {
194        unsafe {
195            ffi::nm_setting_match_clear_interface_names(self.to_glib_none().0);
196        }
197    }
198
199    /// Removes all configured kernel command line arguments.
200    #[cfg(feature = "v1_26")]
201    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
202    #[doc(alias = "nm_setting_match_clear_kernel_command_lines")]
203    pub fn clear_kernel_command_lines(&self) {
204        unsafe {
205            ffi::nm_setting_match_clear_kernel_command_lines(self.to_glib_none().0);
206        }
207    }
208
209    /// Removes all configured paths.
210    #[cfg(feature = "v1_26")]
211    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
212    #[doc(alias = "nm_setting_match_clear_paths")]
213    pub fn clear_paths(&self) {
214        unsafe {
215            ffi::nm_setting_match_clear_paths(self.to_glib_none().0);
216        }
217    }
218
219    /// Since 1.46, access at index "len" is allowed and returns NULL.
220    /// ## `idx`
221    /// index number of the driver to return
222    ///
223    /// # Returns
224    ///
225    /// the driver at index @idx
226    #[cfg(feature = "v1_26")]
227    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
228    #[doc(alias = "nm_setting_match_get_driver")]
229    #[doc(alias = "get_driver")]
230    pub fn driver(&self, idx: u32) -> glib::GString {
231        unsafe {
232            from_glib_none(ffi::nm_setting_match_get_driver(self.to_glib_none().0, idx))
233        }
234    }
235
236    /// Returns all the drivers.
237    ///
238    /// # Returns
239    ///
240    /// the configured drivers.
241    #[cfg(feature = "v1_26")]
242    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
243    #[doc(alias = "nm_setting_match_get_drivers")]
244    #[doc(alias = "get_drivers")]
245    pub fn drivers(&self) -> Vec<glib::GString> {
246        unsafe {
247            let mut length = std::mem::MaybeUninit::uninit();
248            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 _);
249            ret
250        }
251    }
252
253    /// Since 1.46, access at index "len" is allowed and returns NULL.
254    /// ## `idx`
255    /// index number of the DNS search domain to return
256    ///
257    /// # Returns
258    ///
259    /// the interface name at index @idx
260    #[doc(alias = "nm_setting_match_get_interface_name")]
261    #[doc(alias = "get_interface_name")]
262    #[doc(alias = "interface-name")]
263    pub fn interface_name(&self, idx: i32) -> glib::GString {
264        unsafe {
265            from_glib_none(ffi::nm_setting_match_get_interface_name(self.to_glib_none().0, idx))
266        }
267    }
268
269    /// Returns all the interface names.
270    ///
271    /// # Returns
272    ///
273    /// the NULL terminated list of
274    ///   configured interface names.
275    ///
276    /// Before 1.26, the returned array was not [`None`] terminated and you MUST provide a length.
277    #[doc(alias = "nm_setting_match_get_interface_names")]
278    #[doc(alias = "get_interface_names")]
279    pub fn interface_names(&self) -> Vec<glib::GString> {
280        unsafe {
281            let mut length = std::mem::MaybeUninit::uninit();
282            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 _);
283            ret
284        }
285    }
286
287    /// Since 1.46, access at index "len" is allowed and returns NULL.
288    /// ## `idx`
289    /// index number of the kernel command line argument to return
290    ///
291    /// # Returns
292    ///
293    /// the kernel command line argument at index @idx
294    #[cfg(feature = "v1_26")]
295    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
296    #[doc(alias = "nm_setting_match_get_kernel_command_line")]
297    #[doc(alias = "get_kernel_command_line")]
298    #[doc(alias = "kernel-command-line")]
299    pub fn kernel_command_line(&self, idx: u32) -> glib::GString {
300        unsafe {
301            from_glib_none(ffi::nm_setting_match_get_kernel_command_line(self.to_glib_none().0, idx))
302        }
303    }
304
305    /// Returns all the kernel command line arguments.
306    ///
307    /// # Returns
308    ///
309    /// the configured kernel command
310    ///    line arguments.
311    #[cfg(feature = "v1_26")]
312    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
313    #[doc(alias = "nm_setting_match_get_kernel_command_lines")]
314    #[doc(alias = "get_kernel_command_lines")]
315    pub fn kernel_command_lines(&self) -> Vec<glib::GString> {
316        unsafe {
317            let mut length = std::mem::MaybeUninit::uninit();
318            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 _);
319            ret
320        }
321    }
322
323    ///
324    /// # Returns
325    ///
326    /// the number of configured drivers
327    #[cfg(feature = "v1_26")]
328    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
329    #[doc(alias = "nm_setting_match_get_num_drivers")]
330    #[doc(alias = "get_num_drivers")]
331    pub fn num_drivers(&self) -> u32 {
332        unsafe {
333            ffi::nm_setting_match_get_num_drivers(self.to_glib_none().0)
334        }
335    }
336
337    ///
338    /// # Returns
339    ///
340    /// the number of configured interface names
341    #[doc(alias = "nm_setting_match_get_num_interface_names")]
342    #[doc(alias = "get_num_interface_names")]
343    pub fn num_interface_names(&self) -> u32 {
344        unsafe {
345            ffi::nm_setting_match_get_num_interface_names(self.to_glib_none().0)
346        }
347    }
348
349    ///
350    /// # Returns
351    ///
352    /// the number of configured kernel command line arguments
353    #[cfg(feature = "v1_26")]
354    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
355    #[doc(alias = "nm_setting_match_get_num_kernel_command_lines")]
356    #[doc(alias = "get_num_kernel_command_lines")]
357    pub fn num_kernel_command_lines(&self) -> u32 {
358        unsafe {
359            ffi::nm_setting_match_get_num_kernel_command_lines(self.to_glib_none().0)
360        }
361    }
362
363    ///
364    /// # Returns
365    ///
366    /// the number of configured paths
367    #[cfg(feature = "v1_26")]
368    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
369    #[doc(alias = "nm_setting_match_get_num_paths")]
370    #[doc(alias = "get_num_paths")]
371    pub fn num_paths(&self) -> u32 {
372        unsafe {
373            ffi::nm_setting_match_get_num_paths(self.to_glib_none().0)
374        }
375    }
376
377    /// Since 1.46, access at index "len" is allowed and returns NULL.
378    /// ## `idx`
379    /// index number of the path to return
380    ///
381    /// # Returns
382    ///
383    /// the path at index @idx
384    #[cfg(feature = "v1_26")]
385    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
386    #[doc(alias = "nm_setting_match_get_path")]
387    #[doc(alias = "get_path")]
388    pub fn path(&self, idx: u32) -> glib::GString {
389        unsafe {
390            from_glib_none(ffi::nm_setting_match_get_path(self.to_glib_none().0, idx))
391        }
392    }
393
394    /// Returns all the paths.
395    ///
396    /// # Returns
397    ///
398    /// the configured paths.
399    #[cfg(feature = "v1_26")]
400    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
401    #[doc(alias = "nm_setting_match_get_paths")]
402    #[doc(alias = "get_paths")]
403    pub fn paths(&self) -> Vec<glib::GString> {
404        unsafe {
405            let mut length = std::mem::MaybeUninit::uninit();
406            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 _);
407            ret
408        }
409    }
410
411    /// Removes the driver at index @idx.
412    /// ## `idx`
413    /// index number of the driver
414    #[cfg(feature = "v1_26")]
415    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
416    #[doc(alias = "nm_setting_match_remove_driver")]
417    pub fn remove_driver(&self, idx: u32) {
418        unsafe {
419            ffi::nm_setting_match_remove_driver(self.to_glib_none().0, idx);
420        }
421    }
422
423    /// Removes @driver.
424    /// ## `driver`
425    /// the driver to remove
426    ///
427    /// # Returns
428    ///
429    /// [`true`] if the driver was found and removed; [`false`] if it was not.
430    #[cfg(feature = "v1_26")]
431    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
432    #[doc(alias = "nm_setting_match_remove_driver_by_value")]
433    pub fn remove_driver_by_value(&self, driver: &str) -> bool {
434        unsafe {
435            from_glib(ffi::nm_setting_match_remove_driver_by_value(self.to_glib_none().0, driver.to_glib_none().0))
436        }
437    }
438
439    /// Removes the interface name at index @idx.
440    /// ## `idx`
441    /// index number of the interface name
442    #[doc(alias = "nm_setting_match_remove_interface_name")]
443    pub fn remove_interface_name(&self, idx: i32) {
444        unsafe {
445            ffi::nm_setting_match_remove_interface_name(self.to_glib_none().0, idx);
446        }
447    }
448
449    /// Removes @interface_name.
450    /// ## `interface_name`
451    /// the interface name to remove
452    ///
453    /// # Returns
454    ///
455    /// [`true`] if the interface name was found and removed; [`false`] if it was not.
456    #[doc(alias = "nm_setting_match_remove_interface_name_by_value")]
457    pub fn remove_interface_name_by_value(&self, interface_name: &str) -> bool {
458        unsafe {
459            from_glib(ffi::nm_setting_match_remove_interface_name_by_value(self.to_glib_none().0, interface_name.to_glib_none().0))
460        }
461    }
462
463    /// Removes the kernel command line argument at index @idx.
464    /// ## `idx`
465    /// index number of the kernel command line argument
466    #[cfg(feature = "v1_26")]
467    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
468    #[doc(alias = "nm_setting_match_remove_kernel_command_line")]
469    pub fn remove_kernel_command_line(&self, idx: u32) {
470        unsafe {
471            ffi::nm_setting_match_remove_kernel_command_line(self.to_glib_none().0, idx);
472        }
473    }
474
475    /// Removes @kernel_command_line.
476    /// ## `kernel_command_line`
477    /// the kernel command line argument name to remove
478    ///
479    /// # Returns
480    ///
481    /// [`true`] if the kernel command line argument was found and removed; [`false`] if it was not.
482    #[cfg(feature = "v1_26")]
483    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
484    #[doc(alias = "nm_setting_match_remove_kernel_command_line_by_value")]
485    pub fn remove_kernel_command_line_by_value(&self, kernel_command_line: &str) -> bool {
486        unsafe {
487            from_glib(ffi::nm_setting_match_remove_kernel_command_line_by_value(self.to_glib_none().0, kernel_command_line.to_glib_none().0))
488        }
489    }
490
491    /// Removes the path at index @idx.
492    /// ## `idx`
493    /// index number of the path
494    #[cfg(feature = "v1_26")]
495    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
496    #[doc(alias = "nm_setting_match_remove_path")]
497    pub fn remove_path(&self, idx: u32) {
498        unsafe {
499            ffi::nm_setting_match_remove_path(self.to_glib_none().0, idx);
500        }
501    }
502
503    /// Removes @path.
504    /// ## `path`
505    /// the path to remove
506    ///
507    /// # Returns
508    ///
509    /// [`true`] if the path was found and removed; [`false`] if it was not.
510    #[cfg(feature = "v1_26")]
511    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
512    #[doc(alias = "nm_setting_match_remove_path_by_value")]
513    pub fn remove_path_by_value(&self, path: &str) -> bool {
514        unsafe {
515            from_glib(ffi::nm_setting_match_remove_path_by_value(self.to_glib_none().0, path.to_glib_none().0))
516        }
517    }
518
519    /// A list of driver names to match. Each element is a shell wildcard pattern.
520    ///
521    /// See NMSettingMatch:interface-name for how special characters '|', '&',
522    /// '!' and '\\' are used for optional and mandatory matches and inverting the
523    /// pattern.
524    #[cfg(feature = "v1_26")]
525    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
526    pub fn set_driver(&self, driver: &[&str]) {
527        ObjectExt::set_property(self,"driver", driver)
528    }
529
530    /// A list of interface names to match. Each element is a shell wildcard
531    /// pattern.
532    ///
533    /// An element can be prefixed with a pipe symbol (|) or an ampersand (&).
534    /// The former means that the element is optional and the latter means that
535    /// it is mandatory. If there are any optional elements, than the match
536    /// evaluates to true if at least one of the optional element matches
537    /// (logical OR). If there are any mandatory elements, then they all
538    /// must match (logical AND). By default, an element is optional. This means
539    /// that an element "foo" behaves the same as "|foo". An element can also be inverted
540    /// with exclamation mark (!) between the pipe symbol (or the ampersand) and before
541    /// the pattern. Note that "!foo" is a shortcut for the mandatory match "&!foo". Finally,
542    /// a backslash can be used at the beginning of the element (after the optional special characters)
543    /// to escape the start of the pattern. For example, "&\\!a" is an mandatory match for literally "!a".
544    #[cfg(feature = "v1_14")]
545    #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
546    #[doc(alias = "interface-name")]
547    pub fn set_interface_name(&self, interface_name: &[&str]) {
548        ObjectExt::set_property(self,"interface-name", interface_name)
549    }
550
551    /// A list of kernel command line arguments to match. This may be used to check
552    /// whether a specific kernel command line option is set (or unset, if prefixed with
553    /// the exclamation mark). The argument must either be a single word, or
554    /// an assignment (i.e. two words, joined by "="). In the former case the kernel
555    /// command line is searched for the word appearing as is, or as left hand side
556    /// of an assignment. In the latter case, the exact assignment is looked for
557    /// with right and left hand side matching. Wildcard patterns are not supported.
558    ///
559    /// See NMSettingMatch:interface-name for how special characters '|', '&',
560    /// '!' and '\\' are used for optional and mandatory matches and inverting the
561    /// match.
562    #[cfg(feature = "v1_26")]
563    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
564    #[doc(alias = "kernel-command-line")]
565    pub fn set_kernel_command_line(&self, kernel_command_line: &[&str]) {
566        ObjectExt::set_property(self,"kernel-command-line", kernel_command_line)
567    }
568
569    /// A list of paths to match against the ID_PATH udev property of
570    /// devices. ID_PATH represents the topological persistent path of a
571    /// device. It typically contains a subsystem string (pci, usb, platform,
572    /// etc.) and a subsystem-specific identifier.
573    ///
574    /// For PCI devices the path has the form
575    /// "pci-$domain:$bus:$device.$function", where each variable is an
576    /// hexadecimal value; for example "pci-0000:0a:00.0".
577    ///
578    /// The path of a device can be obtained with "udevadm info
579    /// /sys/class/net/$dev | grep ID_PATH=" or by looking at the "path"
580    /// property exported by NetworkManager ("nmcli -f general.path device
581    /// show $dev").
582    ///
583    /// Each element of the list is a shell wildcard pattern.
584    ///
585    /// See NMSettingMatch:interface-name for how special characters '|', '&',
586    /// '!' and '\\' are used for optional and mandatory matches and inverting the
587    /// pattern.
588    #[cfg(feature = "v1_26")]
589    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
590    pub fn set_path(&self, path: &[&str]) {
591        ObjectExt::set_property(self,"path", path)
592    }
593
594    #[cfg(feature = "v1_26")]
595    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
596    #[doc(alias = "driver")]
597    pub fn connect_driver_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
598        unsafe extern "C" fn notify_driver_trampoline<F: Fn(&SettingMatch) + 'static>(this: *mut ffi::NMSettingMatch, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
599            let f: &F = &*(f as *const F);
600            f(&from_glib_borrow(this))
601        }
602        unsafe {
603            let f: Box_<F> = Box_::new(f);
604            connect_raw(self.as_ptr() as *mut _, c"notify::driver".as_ptr() as *const _,
605                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_driver_trampoline::<F> as *const ())), Box_::into_raw(f))
606        }
607    }
608
609    #[cfg(feature = "v1_14")]
610    #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
611    #[doc(alias = "interface-name")]
612    pub fn connect_interface_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
613        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) {
614            let f: &F = &*(f as *const F);
615            f(&from_glib_borrow(this))
616        }
617        unsafe {
618            let f: Box_<F> = Box_::new(f);
619            connect_raw(self.as_ptr() as *mut _, c"notify::interface-name".as_ptr() as *const _,
620                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_interface_name_trampoline::<F> as *const ())), Box_::into_raw(f))
621        }
622    }
623
624    #[cfg(feature = "v1_26")]
625    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
626    #[doc(alias = "kernel-command-line")]
627    pub fn connect_kernel_command_line_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
628        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) {
629            let f: &F = &*(f as *const F);
630            f(&from_glib_borrow(this))
631        }
632        unsafe {
633            let f: Box_<F> = Box_::new(f);
634            connect_raw(self.as_ptr() as *mut _, c"notify::kernel-command-line".as_ptr() as *const _,
635                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_kernel_command_line_trampoline::<F> as *const ())), Box_::into_raw(f))
636        }
637    }
638
639    #[cfg(feature = "v1_26")]
640    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
641    #[doc(alias = "path")]
642    pub fn connect_path_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
643        unsafe extern "C" fn notify_path_trampoline<F: Fn(&SettingMatch) + 'static>(this: *mut ffi::NMSettingMatch, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
644            let f: &F = &*(f as *const F);
645            f(&from_glib_borrow(this))
646        }
647        unsafe {
648            let f: Box_<F> = Box_::new(f);
649            connect_raw(self.as_ptr() as *mut _, c"notify::path".as_ptr() as *const _,
650                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_path_trampoline::<F> as *const ())), Box_::into_raw(f))
651        }
652    }
653}
654
655#[cfg(feature = "v1_32")]
656#[cfg_attr(docsrs, doc(cfg(feature = "v1_32")))]
657impl Default for SettingMatch {
658                     fn default() -> Self {
659                         Self::new()
660                     }
661                 }
662
663// rustdoc-stripper-ignore-next
664        /// A [builder-pattern] type to construct [`SettingMatch`] objects.
665        ///
666        /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
667#[must_use = "The builder must be built to be used"]
668pub struct SettingMatchBuilder {
669            builder: glib::object::ObjectBuilder<'static, SettingMatch>,
670        }
671
672        impl SettingMatchBuilder {
673        fn new() -> Self {
674            Self { builder: glib::object::Object::builder() }
675        }
676
677                            /// A list of driver names to match. Each element is a shell wildcard pattern.
678                            ///
679                            /// See NMSettingMatch:interface-name for how special characters '|', '&',
680                            /// '!' and '\\' are used for optional and mandatory matches and inverting the
681                            /// pattern.
682                            #[cfg(feature = "v1_26")]
683    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
684    pub fn driver(self, driver: impl Into<glib::StrV>) -> Self {
685                            Self { builder: self.builder.property("driver", driver.into()), }
686                        }
687
688                            /// A list of interface names to match. Each element is a shell wildcard
689                            /// pattern.
690                            ///
691                            /// An element can be prefixed with a pipe symbol (|) or an ampersand (&).
692                            /// The former means that the element is optional and the latter means that
693                            /// it is mandatory. If there are any optional elements, than the match
694                            /// evaluates to true if at least one of the optional element matches
695                            /// (logical OR). If there are any mandatory elements, then they all
696                            /// must match (logical AND). By default, an element is optional. This means
697                            /// that an element "foo" behaves the same as "|foo". An element can also be inverted
698                            /// with exclamation mark (!) between the pipe symbol (or the ampersand) and before
699                            /// the pattern. Note that "!foo" is a shortcut for the mandatory match "&!foo". Finally,
700                            /// a backslash can be used at the beginning of the element (after the optional special characters)
701                            /// to escape the start of the pattern. For example, "&\\!a" is an mandatory match for literally "!a".
702                            #[cfg(feature = "v1_14")]
703    #[cfg_attr(docsrs, doc(cfg(feature = "v1_14")))]
704    pub fn interface_name(self, interface_name: impl Into<glib::StrV>) -> Self {
705                            Self { builder: self.builder.property("interface-name", interface_name.into()), }
706                        }
707
708                            /// A list of kernel command line arguments to match. This may be used to check
709                            /// whether a specific kernel command line option is set (or unset, if prefixed with
710                            /// the exclamation mark). The argument must either be a single word, or
711                            /// an assignment (i.e. two words, joined by "="). In the former case the kernel
712                            /// command line is searched for the word appearing as is, or as left hand side
713                            /// of an assignment. In the latter case, the exact assignment is looked for
714                            /// with right and left hand side matching. Wildcard patterns are not supported.
715                            ///
716                            /// See NMSettingMatch:interface-name for how special characters '|', '&',
717                            /// '!' and '\\' are used for optional and mandatory matches and inverting the
718                            /// match.
719                            #[cfg(feature = "v1_26")]
720    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
721    pub fn kernel_command_line(self, kernel_command_line: impl Into<glib::StrV>) -> Self {
722                            Self { builder: self.builder.property("kernel-command-line", kernel_command_line.into()), }
723                        }
724
725                            /// A list of paths to match against the ID_PATH udev property of
726                            /// devices. ID_PATH represents the topological persistent path of a
727                            /// device. It typically contains a subsystem string (pci, usb, platform,
728                            /// etc.) and a subsystem-specific identifier.
729                            ///
730                            /// For PCI devices the path has the form
731                            /// "pci-$domain:$bus:$device.$function", where each variable is an
732                            /// hexadecimal value; for example "pci-0000:0a:00.0".
733                            ///
734                            /// The path of a device can be obtained with "udevadm info
735                            /// /sys/class/net/$dev | grep ID_PATH=" or by looking at the "path"
736                            /// property exported by NetworkManager ("nmcli -f general.path device
737                            /// show $dev").
738                            ///
739                            /// Each element of the list is a shell wildcard pattern.
740                            ///
741                            /// See NMSettingMatch:interface-name for how special characters '|', '&',
742                            /// '!' and '\\' are used for optional and mandatory matches and inverting the
743                            /// pattern.
744                            #[cfg(feature = "v1_26")]
745    #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
746    pub fn path(self, path: impl Into<glib::StrV>) -> Self {
747                            Self { builder: self.builder.property("path", path.into()), }
748                        }
749
750    // rustdoc-stripper-ignore-next
751    /// Build the [`SettingMatch`].
752    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
753    pub fn build(self) -> SettingMatch {
754assert_initialized_main_thread!();
755    self.builder.build() }
756}