glib/gobject/interface_info.rs
1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::gobject_ffi;
4
5/// A structure that provides information to the type system which is
6/// used specifically for managing interface types.
7// rustdoc-stripper-ignore-next-stop
8/// A structure that provides information to the type system which is
9/// used specifically for managing interface types.
10#[derive(Debug, Copy, Clone)]
11#[doc(alias = "GInterfaceInfo")]
12#[repr(transparent)]
13pub struct InterfaceInfo(pub(crate) gobject_ffi::GInterfaceInfo);
14
15impl InterfaceInfo {
16 // rustdoc-stripper-ignore-next
17 /// Returns a `GInterfaceInfo` pointer.
18 #[doc(hidden)]
19 #[inline]
20 pub fn as_ptr(&self) -> *mut gobject_ffi::GInterfaceInfo {
21 &self.0 as *const gobject_ffi::GInterfaceInfo as *mut _
22 }
23
24 // rustdoc-stripper-ignore-next
25 /// Borrows the underlying C value mutably.
26 #[doc(hidden)]
27 #[inline]
28 pub unsafe fn from_glib_ptr_borrow_mut<'a>(
29 ptr: *mut gobject_ffi::GInterfaceInfo,
30 ) -> &'a mut Self {
31 &mut *(ptr as *mut Self)
32 }
33}
34
35impl Default for InterfaceInfo {
36 // rustdoc-stripper-ignore-next
37 /// Creates a new InterfaceInfo with default value.
38 fn default() -> Self {
39 Self(gobject_ffi::GInterfaceInfo {
40 interface_init: None,
41 interface_finalize: None,
42 interface_data: ::std::ptr::null_mut(),
43 })
44 }
45}