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
// 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! {
/// VPN Settings
///
/// ## Properties
///
///
/// #### `data`
/// Dictionary of key/value pairs of VPN plugin specific data. Both keys and
/// values must be strings.
///
/// Readable | Writeable
///
///
/// #### `persistent`
/// If the VPN service supports persistence, and this property is [`true`],
/// the VPN will attempt to stay connected across link changes and outages,
/// until explicitly disconnected.
///
/// Readable | Writeable
///
///
/// #### `secrets`
/// Dictionary of key/value pairs of VPN plugin specific secrets like
/// passwords or private keys. Both keys and values must be strings.
///
/// Readable | Writeable
///
///
/// #### `service-type`
/// D-Bus service name of the VPN plugin that this setting uses to connect to
/// its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc
/// plugin.
///
/// Readable | Writeable
///
///
/// #### `timeout`
/// Timeout for the VPN service to establish the connection. Some services
/// may take quite a long time to connect.
/// Value of 0 means a default timeout, which is 60 seconds (unless overridden
/// by vpn.timeout in configuration file). Values greater than zero mean
/// timeout in seconds.
///
/// Readable | Writeable
///
///
/// #### `user-name`
/// If the VPN connection requires a user name for authentication, that name
/// should be provided here. If the connection is available to more than one
/// user, and the VPN requires each user to supply a different name, then
/// leave this property empty. If this property is empty, NetworkManager
/// will automatically supply the username of the user which requested the
/// VPN connection.
///
/// 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 = "NMSettingVpn")]
pub struct SettingVpn(Object<ffi::NMSettingVpn, ffi::NMSettingVpnClass>) @extends Setting;
match fn {
type_ => || ffi::nm_setting_vpn_get_type(),
}
}
impl SettingVpn {
/// Creates a new #NMSettingVpn object with default values.
///
/// # Returns
///
/// the new empty #NMSettingVpn object
#[doc(alias = "nm_setting_vpn_new")]
pub fn new() -> SettingVpn {
assert_initialized_main_thread!();
unsafe {
Setting::from_glib_full(ffi::nm_setting_vpn_new()).unsafe_cast()
}
}
// rustdoc-stripper-ignore-next
/// Creates a new builder-pattern struct instance to construct [`SettingVpn`] objects.
///
/// This method returns an instance of [`SettingVpnBuilder`](crate::builders::SettingVpnBuilder) which can be used to create [`SettingVpn`] objects.
pub fn builder() -> SettingVpnBuilder {
SettingVpnBuilder::new()
}
/// Establishes a relationship between @key and @item internally in the
/// setting which may be retrieved later. Should not be used to store passwords
/// or other secrets, which is what nm_setting_vpn_add_secret() is for.
///
/// Before 1.24, @item must not be [`None`] and not an empty string. Since 1.24,
/// @item can be set to an empty string. It can also be set to [`None`] to unset
/// the key. In that case, the behavior is as if calling nm_setting_vpn_remove_data_item().
/// ## `key`
/// a name that uniquely identifies the given value @item
/// ## `item`
/// the value to be referenced by @key
#[doc(alias = "nm_setting_vpn_add_data_item")]
pub fn add_data_item(&self, key: &str, item: Option<&str>) {
unsafe {
ffi::nm_setting_vpn_add_data_item(self.to_glib_none().0, key.to_glib_none().0, item.to_glib_none().0);
}
}
/// Establishes a relationship between @key and @secret internally in the
/// setting which may be retrieved later.
///
/// Before 1.24, @secret must not be [`None`] and not an empty string. Since 1.24,
/// @secret can be set to an empty string. It can also be set to [`None`] to unset
/// the key. In that case, the behavior is as if calling nm_setting_vpn_remove_secret().
/// ## `key`
/// a name that uniquely identifies the given secret @secret
/// ## `secret`
/// the secret to be referenced by @key
#[doc(alias = "nm_setting_vpn_add_secret")]
pub fn add_secret(&self, key: &str, secret: Option<&str>) {
unsafe {
ffi::nm_setting_vpn_add_secret(self.to_glib_none().0, key.to_glib_none().0, secret.to_glib_none().0);
}
}
/// Iterates all data items stored in this setting. It is safe to add, remove,
/// and modify data items inside @func, though any additions or removals made
/// during iteration will not be part of the iteration.
/// ## `func`
/// an user provided function
#[doc(alias = "nm_setting_vpn_foreach_data_item")]
pub fn foreach_data_item<P: FnMut(&str, &str)>(&self, func: P) {
let mut func_data: P = func;
unsafe extern "C" fn func_func<P: FnMut(&str, &str)>(key: *const std::ffi::c_char, value: *const std::ffi::c_char, user_data: glib::ffi::gpointer) {
let key: Borrowed<glib::GString> = from_glib_borrow(key);
let value: Borrowed<glib::GString> = from_glib_borrow(value);
let callback = user_data as *mut P;
(*callback)(key.as_str(), value.as_str())
}
let func = Some(func_func::<P> as _);
let super_callback0: &mut P = &mut func_data;
unsafe {
ffi::nm_setting_vpn_foreach_data_item(self.to_glib_none().0, func, super_callback0 as *mut _ as *mut _);
}
}
/// Iterates all secrets stored in this setting. It is safe to add, remove,
/// and modify secrets inside @func, though any additions or removals made during
/// iteration will not be part of the iteration.
/// ## `func`
/// an user provided function
#[doc(alias = "nm_setting_vpn_foreach_secret")]
pub fn foreach_secret<P: FnMut(&str, &str)>(&self, func: P) {
let mut func_data: P = func;
unsafe extern "C" fn func_func<P: FnMut(&str, &str)>(key: *const std::ffi::c_char, value: *const std::ffi::c_char, user_data: glib::ffi::gpointer) {
let key: Borrowed<glib::GString> = from_glib_borrow(key);
let value: Borrowed<glib::GString> = from_glib_borrow(value);
let callback = user_data as *mut P;
(*callback)(key.as_str(), value.as_str())
}
let func = Some(func_func::<P> as _);
let super_callback0: &mut P = &mut func_data;
unsafe {
ffi::nm_setting_vpn_foreach_secret(self.to_glib_none().0, func, super_callback0 as *mut _ as *mut _);
}
}
/// Retrieves the data item of a key/value relationship previously established
/// by nm_setting_vpn_add_data_item().
/// ## `key`
/// the name of the data item to retrieve
///
/// # Returns
///
/// the data item, if any
#[doc(alias = "nm_setting_vpn_get_data_item")]
#[doc(alias = "get_data_item")]
pub fn data_item(&self, key: &str) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_vpn_get_data_item(self.to_glib_none().0, key.to_glib_none().0))
}
}
/// Retrieves every data key inside @self, as an array.
///
/// # Returns
///
/// a
/// [`None`]-terminated array containing each data key or [`None`] if
/// there are no data items.
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_vpn_get_data_keys")]
#[doc(alias = "get_data_keys")]
pub fn data_keys(&self) -> Vec<glib::GString> {
unsafe {
let mut out_length = std::mem::MaybeUninit::uninit();
let ret = FromGlibContainer::from_glib_container_num(ffi::nm_setting_vpn_get_data_keys(self.to_glib_none().0, out_length.as_mut_ptr()), out_length.assume_init() as _);
ret
}
}
/// Gets number of key/value pairs of VPN configuration data.
///
/// # Returns
///
/// the number of VPN plugin specific configuration data items
#[doc(alias = "nm_setting_vpn_get_num_data_items")]
#[doc(alias = "get_num_data_items")]
pub fn num_data_items(&self) -> u32 {
unsafe {
ffi::nm_setting_vpn_get_num_data_items(self.to_glib_none().0)
}
}
/// Gets number of VPN plugin specific secrets in the setting.
///
/// # Returns
///
/// the number of VPN plugin specific secrets
#[doc(alias = "nm_setting_vpn_get_num_secrets")]
#[doc(alias = "get_num_secrets")]
pub fn num_secrets(&self) -> u32 {
unsafe {
ffi::nm_setting_vpn_get_num_secrets(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// the #NMSettingVpn:persistent property of the setting
#[cfg(feature = "v1_42")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
#[doc(alias = "nm_setting_vpn_get_persistent")]
#[doc(alias = "get_persistent")]
#[doc(alias = "persistent")]
pub fn is_persistent(&self) -> bool {
unsafe {
from_glib(ffi::nm_setting_vpn_get_persistent(self.to_glib_none().0))
}
}
/// Retrieves the secret of a key/value relationship previously established
/// by nm_setting_vpn_add_secret().
/// ## `key`
/// the name of the secret to retrieve
///
/// # Returns
///
/// the secret, if any
#[doc(alias = "nm_setting_vpn_get_secret")]
#[doc(alias = "get_secret")]
pub fn secret(&self, key: &str) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_vpn_get_secret(self.to_glib_none().0, key.to_glib_none().0))
}
}
/// Retrieves every secret key inside @self, as an array.
///
/// # Returns
///
/// a
/// [`None`]-terminated array containing each secret key or [`None`] if
/// there are no secrets.
#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(alias = "nm_setting_vpn_get_secret_keys")]
#[doc(alias = "get_secret_keys")]
pub fn secret_keys(&self) -> Vec<glib::GString> {
unsafe {
let mut out_length = std::mem::MaybeUninit::uninit();
let ret = FromGlibContainer::from_glib_container_num(ffi::nm_setting_vpn_get_secret_keys(self.to_glib_none().0, out_length.as_mut_ptr()), out_length.assume_init() as _);
ret
}
}
/// Returns the service name of the VPN, which identifies the specific VPN
/// plugin that should be used to connect to this VPN.
///
/// # Returns
///
/// the VPN plugin's service name
#[doc(alias = "nm_setting_vpn_get_service_type")]
#[doc(alias = "get_service_type")]
#[doc(alias = "service-type")]
pub fn service_type(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_vpn_get_service_type(self.to_glib_none().0))
}
}
///
/// # Returns
///
/// the #NMSettingVpn:timeout property of the setting
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "nm_setting_vpn_get_timeout")]
#[doc(alias = "get_timeout")]
pub fn timeout(&self) -> u32 {
unsafe {
ffi::nm_setting_vpn_get_timeout(self.to_glib_none().0)
}
}
///
/// # Returns
///
/// the #NMSettingVpn:user-name property of the setting
#[doc(alias = "nm_setting_vpn_get_user_name")]
#[doc(alias = "get_user_name")]
#[doc(alias = "user-name")]
pub fn user_name(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_setting_vpn_get_user_name(self.to_glib_none().0))
}
}
/// Deletes a key/value relationship previously established by
/// nm_setting_vpn_add_data_item().
/// ## `key`
/// the name of the data item to remove
///
/// # Returns
///
/// [`true`] if the data item was found and removed from the internal list,
/// [`false`] if it was not.
#[doc(alias = "nm_setting_vpn_remove_data_item")]
pub fn remove_data_item(&self, key: &str) -> bool {
unsafe {
from_glib(ffi::nm_setting_vpn_remove_data_item(self.to_glib_none().0, key.to_glib_none().0))
}
}
/// Deletes a key/value relationship previously established by
/// nm_setting_vpn_add_secret().
/// ## `key`
/// the name of the secret to remove
///
/// # Returns
///
/// [`true`] if the secret was found and removed from the internal list,
/// [`false`] if it was not.
#[doc(alias = "nm_setting_vpn_remove_secret")]
pub fn remove_secret(&self, key: &str) -> bool {
unsafe {
from_glib(ffi::nm_setting_vpn_remove_secret(self.to_glib_none().0, key.to_glib_none().0))
}
}
//pub fn data(&self) -> /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } {
// ObjectExt::property(self, "data")
//}
//pub fn set_data(&self, data: /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }) {
// ObjectExt::set_property(self,"data", data)
//}
#[cfg(not(feature = "v1_42"))]
#[cfg_attr(docsrs, doc(cfg(not(feature = "v1_42"))))]
pub fn is_persistent(&self) -> bool {
ObjectExt::property(self, "persistent")
}
/// If the VPN service supports persistence, and this property is [`true`],
/// the VPN will attempt to stay connected across link changes and outages,
/// until explicitly disconnected.
pub fn set_persistent(&self, persistent: bool) {
ObjectExt::set_property(self,"persistent", persistent)
}
//pub fn secrets(&self) -> /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } {
// ObjectExt::property(self, "secrets")
//}
//pub fn set_secrets(&self, secrets: /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }) {
// ObjectExt::set_property(self,"secrets", secrets)
//}
/// D-Bus service name of the VPN plugin that this setting uses to connect to
/// its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc
/// plugin.
#[doc(alias = "service-type")]
pub fn set_service_type(&self, service_type: Option<&str>) {
ObjectExt::set_property(self,"service-type", service_type)
}
/// Timeout for the VPN service to establish the connection. Some services
/// may take quite a long time to connect.
/// Value of 0 means a default timeout, which is 60 seconds (unless overridden
/// by vpn.timeout in configuration file). Values greater than zero mean
/// timeout in seconds.
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn set_timeout(&self, timeout: u32) {
ObjectExt::set_property(self,"timeout", timeout)
}
/// If the VPN connection requires a user name for authentication, that name
/// should be provided here. If the connection is available to more than one
/// user, and the VPN requires each user to supply a different name, then
/// leave this property empty. If this property is empty, NetworkManager
/// will automatically supply the username of the user which requested the
/// VPN connection.
#[doc(alias = "user-name")]
pub fn set_user_name(&self, user_name: Option<&str>) {
ObjectExt::set_property(self,"user-name", user_name)
}
#[doc(alias = "data")]
pub fn connect_data_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_data_trampoline<F: Fn(&SettingVpn) + 'static>(this: *mut ffi::NMSettingVpn, _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::data".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_data_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[doc(alias = "persistent")]
pub fn connect_persistent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_persistent_trampoline<F: Fn(&SettingVpn) + 'static>(this: *mut ffi::NMSettingVpn, _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::persistent".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_persistent_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[doc(alias = "secrets")]
pub fn connect_secrets_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_secrets_trampoline<F: Fn(&SettingVpn) + 'static>(this: *mut ffi::NMSettingVpn, _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::secrets".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_secrets_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[doc(alias = "service-type")]
pub fn connect_service_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_service_type_trampoline<F: Fn(&SettingVpn) + 'static>(this: *mut ffi::NMSettingVpn, _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::service-type".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_service_type_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(alias = "timeout")]
pub fn connect_timeout_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_timeout_trampoline<F: Fn(&SettingVpn) + 'static>(this: *mut ffi::NMSettingVpn, _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::timeout".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_timeout_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
#[doc(alias = "user-name")]
pub fn connect_user_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_user_name_trampoline<F: Fn(&SettingVpn) + 'static>(this: *mut ffi::NMSettingVpn, _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::user-name".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_user_name_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
}
impl Default for SettingVpn {
fn default() -> Self {
Self::new()
}
}
// rustdoc-stripper-ignore-next
/// A [builder-pattern] type to construct [`SettingVpn`] 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 SettingVpnBuilder {
builder: glib::object::ObjectBuilder<'static, SettingVpn>,
}
impl SettingVpnBuilder {
fn new() -> Self {
Self { builder: glib::object::Object::builder() }
}
//pub fn data(self, data: /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }) -> Self {
// Self { builder: self.builder.property("data", data), }
//}
/// If the VPN service supports persistence, and this property is [`true`],
/// the VPN will attempt to stay connected across link changes and outages,
/// until explicitly disconnected.
pub fn persistent(self, persistent: bool) -> Self {
Self { builder: self.builder.property("persistent", persistent), }
}
//pub fn secrets(self, secrets: /*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }) -> Self {
// Self { builder: self.builder.property("secrets", secrets), }
//}
/// D-Bus service name of the VPN plugin that this setting uses to connect to
/// its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc
/// plugin.
pub fn service_type(self, service_type: impl Into<glib::GString>) -> Self {
Self { builder: self.builder.property("service-type", service_type.into()), }
}
/// Timeout for the VPN service to establish the connection. Some services
/// may take quite a long time to connect.
/// Value of 0 means a default timeout, which is 60 seconds (unless overridden
/// by vpn.timeout in configuration file). Values greater than zero mean
/// timeout in seconds.
#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
pub fn timeout(self, timeout: u32) -> Self {
Self { builder: self.builder.property("timeout", timeout), }
}
/// If the VPN connection requires a user name for authentication, that name
/// should be provided here. If the connection is available to more than one
/// user, and the VPN requires each user to supply a different name, then
/// leave this property empty. If this property is empty, NetworkManager
/// will automatically supply the username of the user which requested the
/// VPN connection.
pub fn user_name(self, user_name: impl Into<glib::GString>) -> Self {
Self { builder: self.builder.property("user-name", user_name.into()), }
}
// rustdoc-stripper-ignore-next
/// Build the [`SettingVpn`].
#[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
pub fn build(self) -> SettingVpn {
assert_initialized_main_thread!();
self.builder.build() }
}