gio/
dbus_interface_info.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use std::ffi::CStr;
4
5use crate::DBusInterfaceInfo;
6
7impl DBusInterfaceInfo {
8    pub fn name(&self) -> &str {
9        unsafe {
10            let c_obj = self.as_ptr();
11            let name = (*c_obj).name;
12            assert!(!name.is_null());
13            let c_str = CStr::from_ptr(name);
14            c_str.to_str().unwrap()
15        }
16    }
17}