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
// 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::{Connection, ffi};
use glib::{prelude::*, translate::*};
glib::wrapper! {
///
///
/// # Implements
///
/// [`ConnectionExt`][trait@crate::prelude::ConnectionExt]
#[doc(alias = "NMSimpleConnection")]
pub struct SimpleConnection(Object<ffi::NMSimpleConnection, ffi::NMSimpleConnectionClass>) @implements Connection;
match fn {
type_ => || ffi::nm_simple_connection_get_type(),
}
}
impl SimpleConnection {
/// Creates a new #NMSimpleConnection object with no #NMSetting objects.
///
/// # Returns
///
/// the new empty #NMConnection object
#[doc(alias = "nm_simple_connection_new")]
pub fn new() -> Connection {
assert_initialized_main_thread!();
unsafe { from_glib_full(ffi::nm_simple_connection_new()) }
}
/// Clones an #NMConnection as an #NMSimpleConnection.
/// ## `connection`
/// the #NMConnection to clone
///
/// # Returns
///
/// a new #NMConnection containing the same settings
/// and properties as the source #NMConnection
#[doc(alias = "nm_simple_connection_new_clone")]
pub fn new_clone(connection: &impl IsA<Connection>) -> Connection {
skip_assert_initialized!();
unsafe {
from_glib_full(ffi::nm_simple_connection_new_clone(
connection.as_ref().to_glib_none().0,
))
}
}
//#[doc(alias = "nm_simple_connection_new_from_dbus")]
//pub fn new_from_dbus(dict: /*Ignored*/&glib::Variant) -> Result<Connection, glib::Error> {
// unsafe { TODO: call ffi:nm_simple_connection_new_from_dbus() }
//}
}
impl Default for SimpleConnection {
fn default() -> Self {
Self::new()
.downcast()
.expect("Casting from SimpleConnection should not panic.")
}
}