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
// 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};
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
///
///
/// #### `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
///
/// # Implements
///
/// [`ObjectExt`][trait@crate::prelude::ObjectExt]
#[doc(alias = "NMObject")]
pub struct Object(Object<ffi::NMObject, ffi::NMObjectClass>);
match fn {
type_ => || ffi::nm_object_get_type(),
}
}
impl Object {
pub const NONE: Option<&'static Object> = None;
}
/// Trait containing all [`struct@Object`] methods.
///
/// # Implementors
///
/// [`AccessPoint`][struct@crate::AccessPoint], [`ActiveConnection`][struct@crate::ActiveConnection], [`Checkpoint`][struct@crate::Checkpoint], [`Device`][struct@crate::Device], [`DhcpConfig`][struct@crate::DhcpConfig], [`IPConfig`][struct@crate::IPConfig], [`Object`][struct@crate::Object], [`RemoteConnection`][struct@crate::RemoteConnection], [`WifiP2PPeer`][struct@crate::WifiP2PPeer], [`WimaxNsp`][struct@crate::WimaxNsp]
pub trait ObjectExt: IsA<Object> + 'static {
//#[cfg(feature = "v1_24")]
//#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
//#[doc(alias = "nm_object_get_client")]
//#[doc(alias = "get_client")]
//fn client(&self) -> /*Unimplemented*/Option<Basic: Pointer> {
// unsafe { TODO: call ffi:nm_object_get_client() }
//}
/// Gets the DBus path of the #NMObject.
///
/// # Returns
///
/// the object's path. This is the internal string used by the
/// object, and must not be modified.
///
/// Note that the D-Bus path of an NMObject never changes, even
/// if the instance gets removed from the cache. To find out
/// whether the object is still alive/cached, check nm_object_get_client().
#[doc(alias = "nm_object_get_path")]
#[doc(alias = "get_path")]
fn path(&self) -> glib::GString {
unsafe {
from_glib_none(ffi::nm_object_get_path(self.as_ref().to_glib_none().0))
}
}
#[cfg(feature = "v1_34")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_34")))]
#[doc(alias = "client")]
fn connect_client_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_client_trampoline<P: IsA<Object>, F: Fn(&P) + 'static>(this: *mut ffi::NMObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(Object::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, c"notify::client".as_ptr() as *const _,
Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(notify_client_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
#[doc(alias = "path")]
fn connect_path_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_path_trampoline<P: IsA<Object>, F: Fn(&P) + 'static>(this: *mut ffi::NMObject, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(Object::from_glib_borrow(this).unsafe_cast_ref())
}
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::<Self, F> as *const ())), Box_::into_raw(f))
}
}
}
impl<O: IsA<Object>> ObjectExt for O {}