gio/auto/
dbus_interface_info.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, DBusMethodInfo, DBusPropertyInfo, DBusSignalInfo};
6use glib::translate::*;
7
8glib::wrapper! {
9    /// Information about a D-Bus interface.
10    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
11    pub struct DBusInterfaceInfo(Shared<ffi::GDBusInterfaceInfo>);
12
13    match fn {
14        ref => |ptr| ffi::g_dbus_interface_info_ref(ptr),
15        unref => |ptr| ffi::g_dbus_interface_info_unref(ptr),
16        type_ => || ffi::g_dbus_interface_info_get_type(),
17    }
18}
19
20impl DBusInterfaceInfo {
21    //#[doc(alias = "g_dbus_interface_info_generate_xml")]
22    //pub fn generate_xml(&self, indent: u32, string_builder: /*Ignored*/&mut glib::String) {
23    //    unsafe { TODO: call ffi:g_dbus_interface_info_generate_xml() }
24    //}
25
26    /// Looks up information about a method.
27    ///
28    /// The cost of this function is O(n) in number of methods unless
29    /// g_dbus_interface_info_cache_build() has been used on @self.
30    /// ## `name`
31    /// A D-Bus method name (typically in CamelCase)
32    ///
33    /// # Returns
34    ///
35    /// A #GDBusMethodInfo or [`None`] if not found. Do not free, it is owned by @self.
36    #[doc(alias = "g_dbus_interface_info_lookup_method")]
37    pub fn lookup_method(&self, name: &str) -> Option<DBusMethodInfo> {
38        unsafe {
39            from_glib_none(ffi::g_dbus_interface_info_lookup_method(
40                self.to_glib_none().0,
41                name.to_glib_none().0,
42            ))
43        }
44    }
45
46    /// Looks up information about a property.
47    ///
48    /// The cost of this function is O(n) in number of properties unless
49    /// g_dbus_interface_info_cache_build() has been used on @self.
50    /// ## `name`
51    /// A D-Bus property name (typically in CamelCase).
52    ///
53    /// # Returns
54    ///
55    /// A #GDBusPropertyInfo or [`None`] if not found. Do not free, it is owned by @self.
56    #[doc(alias = "g_dbus_interface_info_lookup_property")]
57    pub fn lookup_property(&self, name: &str) -> Option<DBusPropertyInfo> {
58        unsafe {
59            from_glib_none(ffi::g_dbus_interface_info_lookup_property(
60                self.to_glib_none().0,
61                name.to_glib_none().0,
62            ))
63        }
64    }
65
66    /// Looks up information about a signal.
67    ///
68    /// The cost of this function is O(n) in number of signals unless
69    /// g_dbus_interface_info_cache_build() has been used on @self.
70    /// ## `name`
71    /// A D-Bus signal name (typically in CamelCase)
72    ///
73    /// # Returns
74    ///
75    /// A #GDBusSignalInfo or [`None`] if not found. Do not free, it is owned by @self.
76    #[doc(alias = "g_dbus_interface_info_lookup_signal")]
77    pub fn lookup_signal(&self, name: &str) -> Option<DBusSignalInfo> {
78        unsafe {
79            from_glib_none(ffi::g_dbus_interface_info_lookup_signal(
80                self.to_glib_none().0,
81                name.to_glib_none().0,
82            ))
83        }
84    }
85}