Skip to main content

gio/auto/
dbus_object_proxy.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{DBusConnection, DBusObject, ffi};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "GDBusObjectProxy")]
10    pub struct DBusObjectProxy(Object<ffi::GDBusObjectProxy, ffi::GDBusObjectProxyClass>) @implements DBusObject;
11
12    match fn {
13        type_ => || ffi::g_dbus_object_proxy_get_type(),
14    }
15}
16
17impl DBusObjectProxy {
18    pub const NONE: Option<&'static DBusObjectProxy> = None;
19
20    #[doc(alias = "g_dbus_object_proxy_new")]
21    pub fn new(connection: &DBusConnection, object_path: &str) -> DBusObjectProxy {
22        unsafe {
23            from_glib_full(ffi::g_dbus_object_proxy_new(
24                connection.to_glib_none().0,
25                object_path.to_glib_none().0,
26            ))
27        }
28    }
29}
30
31pub trait DBusObjectProxyExt: IsA<DBusObjectProxy> + 'static {
32    #[doc(alias = "g_dbus_object_proxy_get_connection")]
33    #[doc(alias = "get_connection")]
34    #[doc(alias = "g-connection")]
35    fn connection(&self) -> DBusConnection {
36        unsafe {
37            from_glib_none(ffi::g_dbus_object_proxy_get_connection(
38                self.as_ref().to_glib_none().0,
39            ))
40        }
41    }
42
43    #[doc(alias = "g-connection")]
44    fn g_connection(&self) -> Option<DBusConnection> {
45        ObjectExt::property(self.as_ref(), "g-connection")
46    }
47
48    #[doc(alias = "g-object-path")]
49    fn g_object_path(&self) -> Option<glib::GString> {
50        ObjectExt::property(self.as_ref(), "g-object-path")
51    }
52}
53
54impl<O: IsA<DBusObjectProxy>> DBusObjectProxyExt for O {}