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
// 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
#![allow(deprecated)]
use crate::{ffi,Connection,Object,WimaxNspNetworkType};
use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*};
use std::{boxed::Box as Box_};
glib::wrapper! {
/// WiMAX is no longer supported by NetworkManager since 1.2.0.
///
///
/// ## Properties
///
///
/// #### `name`
/// The name of the WiMAX NSP.
///
/// Readable
///
///
/// #### `network-type`
/// The network type of the WiMAX NSP.
///
/// Readable
///
///
/// #### `signal-quality`
/// The signal quality of the WiMAX NSP.
///
/// 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 = "NMWimaxNsp")]
pub struct WimaxNsp(Object<ffi::NMWimaxNsp, ffi::NMWimaxNspClass>) @extends Object;
match fn {
type_ => || ffi::nm_wimax_nsp_get_type(),
}
}
impl WimaxNsp {
/// Validates a given connection against a given WiMAX NSP to ensure that the
/// connection may be activated with that NSP. The connection must match the
/// @self's network name and other attributes.
///
/// # Deprecated since 1.22
///
/// WiMAX is no longer supported by NetworkManager since 1.2.0.
/// ## `connection`
/// an #NMConnection to validate against @self
///
/// # Returns
///
/// [`true`] if the connection may be activated with this WiMAX NSP,
/// [`false`] if it cannot be.
#[cfg_attr(feature = "v1_22", deprecated = "Since 1.22")]
#[allow(deprecated)]
#[doc(alias = "nm_wimax_nsp_connection_valid")]
pub fn connection_valid(&self, connection: &impl IsA<Connection>) -> bool {
unsafe {
from_glib(ffi::nm_wimax_nsp_connection_valid(self.to_glib_none().0, connection.as_ref().to_glib_none().0))
}
}
/// Filters a given array of connections for a given #NMWimaxNsp object and
/// return connections which may be activated with the NSP. Any returned
/// connections will match the @self's network name and other attributes.
///
/// # Deprecated since 1.22
///
/// WiMAX is no longer supported by NetworkManager since 1.2.0.
/// ## `connections`
/// an array of #NMConnections to
/// filter
///
/// # Returns
///
/// an array of
/// #NMConnections that could be activated with the given @self. The array should
/// be freed with g_ptr_array_unref() when it is no longer required.
#[cfg_attr(feature = "v1_22", deprecated = "Since 1.22")]
#[allow(deprecated)]
#[doc(alias = "nm_wimax_nsp_filter_connections")]
pub fn filter_connections(&self, connections: &[Connection]) -> Vec<Connection> {
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::nm_wimax_nsp_filter_connections(self.to_glib_none().0, connections.to_glib_none().0))
}
}
/// Gets the name of the wimax NSP
///
/// # Deprecated since 1.22
///
/// WiMAX is no longer supported by NetworkManager since 1.2.0.
///
/// # Returns
///
/// the name
#[cfg_attr(feature = "v1_22", deprecated = "Since 1.22")]
#[allow(deprecated)]
#[doc(alias = "nm_wimax_nsp_get_name")]
#[doc(alias = "get_name")]
pub fn name(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_wimax_nsp_get_name(self.to_glib_none().0))
}
}
/// Gets the network type of the wimax NSP.
///
/// # Deprecated since 1.22
///
/// WiMAX is no longer supported by NetworkManager since 1.2.0.
///
/// # Returns
///
/// the network type
#[cfg_attr(feature = "v1_22", deprecated = "Since 1.22")]
#[allow(deprecated)]
#[doc(alias = "nm_wimax_nsp_get_network_type")]
#[doc(alias = "get_network_type")]
#[doc(alias = "network-type")]
pub fn network_type(&self) -> WimaxNspNetworkType {
unsafe {
from_glib(ffi::nm_wimax_nsp_get_network_type(self.to_glib_none().0))
}
}
/// Gets the WPA signal quality of the wimax NSP.
///
/// # Deprecated since 1.22
///
/// WiMAX is no longer supported by NetworkManager since 1.2.0.
///
/// # Returns
///
/// the signal quality
#[cfg_attr(feature = "v1_22", deprecated = "Since 1.22")]
#[allow(deprecated)]
#[doc(alias = "nm_wimax_nsp_get_signal_quality")]
#[doc(alias = "get_signal_quality")]
#[doc(alias = "signal-quality")]
pub fn signal_quality(&self) -> u32 {
unsafe {
ffi::nm_wimax_nsp_get_signal_quality(self.to_glib_none().0)
}
}
#[cfg_attr(feature = "v1_22", deprecated = "Since 1.22")]
#[doc(alias = "name")]
pub fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_name_trampoline<F: Fn(&WimaxNsp) + 'static>(this: *mut ffi::NMWimaxNsp, _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::name".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_name_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg_attr(feature = "v1_22", deprecated = "Since 1.22")]
#[doc(alias = "network-type")]
pub fn connect_network_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_network_type_trampoline<F: Fn(&WimaxNsp) + 'static>(this: *mut ffi::NMWimaxNsp, _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::network-type".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_network_type_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg_attr(feature = "v1_22", deprecated = "Since 1.22")]
#[doc(alias = "signal-quality")]
pub fn connect_signal_quality_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_signal_quality_trampoline<F: Fn(&WimaxNsp) + 'static>(this: *mut ffi::NMWimaxNsp, _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::signal-quality".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_signal_quality_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
}
impl std::fmt::Display for WimaxNsp {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str(&self.name())
}
}