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
// 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,Object};
use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
use std::{boxed::Box as Box_};
glib::wrapper! {
///
///
/// This is an Abstract Base Class, you cannot instantiate it.
///
/// ## Properties
///
///
/// #### `family`
/// The IP address family of the configuration; either
/// <literal>AF_INET</literal> or <literal>AF_INET6</literal>.
///
/// Readable
///
///
/// #### `options`
/// The #GHashTable containing options of the configuration.
///
/// Readable
/// <details><summary><h4>Object</h4></summary>
///
///
/// #### `client`
/// The NMClient instance as returned by nm_object_get_client().
///
/// When an NMObject gets removed from the NMClient cache,
/// the NMObject:path property stays unchanged, but this client
/// instance gets reset to [`None`]. You can use this property to
/// track removal of the object from the cache.
///
/// Readable
///
///
/// #### `path`
/// The D-Bus object path.
///
/// The D-Bus path of an object instance never changes, even if the object
/// gets removed from the cache. To see whether the object is still in the
/// cache, check NMObject:client.
///
/// Readable
/// </details>
///
/// # Implements
///
/// [`ObjectExt`][trait@crate::prelude::ObjectExt]
#[doc(alias = "NMDhcpConfig")]
pub struct DhcpConfig(Object<ffi::NMDhcpConfig, ffi::NMDhcpConfigClass>) @extends Object;
match fn {
type_ => || ffi::nm_dhcp_config_get_type(),
}
}
impl DhcpConfig {
/// Gets the IP address family of the configuration
///
/// # Returns
///
/// the IP address family; either <literal>AF_INET</literal> or
/// <literal>AF_INET6</literal>
#[doc(alias = "nm_dhcp_config_get_family")]
#[doc(alias = "get_family")]
pub fn family(&self) -> i32 {
unsafe {
ffi::nm_dhcp_config_get_family(self.to_glib_none().0)
}
}
/// Gets one option by option name.
/// ## `option`
/// the option to retrieve
///
/// # Returns
///
/// the configuration option's value. This is the internal string used by the
/// configuration, and must not be modified.
#[doc(alias = "nm_dhcp_config_get_one_option")]
#[doc(alias = "get_one_option")]
pub fn one_option(&self, option: &str) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_dhcp_config_get_one_option(self.to_glib_none().0, option.to_glib_none().0))
}
}
//#[doc(alias = "nm_dhcp_config_get_options")]
//#[doc(alias = "get_options")]
//pub fn options(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } {
// unsafe { TODO: call ffi:nm_dhcp_config_get_options() }
//}
#[doc(alias = "family")]
pub fn connect_family_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_family_trampoline<F: Fn(&DhcpConfig) + 'static>(this: *mut ffi::NMDhcpConfig, _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::family".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_family_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[doc(alias = "options")]
pub fn connect_options_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_options_trampoline<F: Fn(&DhcpConfig) + 'static>(this: *mut ffi::NMDhcpConfig, _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::options".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_options_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
}