gio/auto/
dbus_interface.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::{ffi, DBusInterfaceInfo, DBusObject};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "GDBusInterface")]
10    pub struct DBusInterface(Interface<ffi::GDBusInterface, ffi::GDBusInterfaceIface>);
11
12    match fn {
13        type_ => || ffi::g_dbus_interface_get_type(),
14    }
15}
16
17impl DBusInterface {
18    pub const NONE: Option<&'static DBusInterface> = None;
19}
20
21pub trait DBusInterfaceExt: IsA<DBusInterface> + 'static {
22    #[doc(alias = "g_dbus_interface_dup_object")]
23    #[doc(alias = "dup_object")]
24    fn get(&self) -> Option<DBusObject> {
25        unsafe {
26            from_glib_full(ffi::g_dbus_interface_dup_object(
27                self.as_ref().to_glib_none().0,
28            ))
29        }
30    }
31
32    #[doc(alias = "g_dbus_interface_get_info")]
33    #[doc(alias = "get_info")]
34    fn info(&self) -> DBusInterfaceInfo {
35        unsafe {
36            from_glib_none(ffi::g_dbus_interface_get_info(
37                self.as_ref().to_glib_none().0,
38            ))
39        }
40    }
41
42    #[doc(alias = "g_dbus_interface_set_object")]
43    fn set_object(&self, object: Option<&impl IsA<DBusObject>>) {
44        unsafe {
45            ffi::g_dbus_interface_set_object(
46                self.as_ref().to_glib_none().0,
47                object.map(|p| p.as_ref()).to_glib_none().0,
48            );
49        }
50    }
51}
52
53impl<O: IsA<DBusInterface>> DBusInterfaceExt for O {}