1 | // Take a look at the license at the top of the repository in the LICENSE file. |
2 | |
3 | use crate::gobject_ffi; |
4 | |
5 | #[derive (Debug, Copy, Clone)] |
6 | #[doc (alias = "GTypeValueTable" )] |
7 | #[repr (transparent)] |
8 | pub struct TypeValueTable(pub(crate) gobject_ffi::GTypeValueTable); |
9 | |
10 | impl TypeValueTable { |
11 | // rustdoc-stripper-ignore-next |
12 | /// Returns a `GTypeValueTable` pointer. |
13 | #[doc (hidden)] |
14 | #[inline ] |
15 | pub fn as_ptr(&self) -> *mut gobject_ffi::GTypeValueTable { |
16 | &self.0 as *const gobject_ffi::GTypeValueTable as *mut _ |
17 | } |
18 | |
19 | // rustdoc-stripper-ignore-next |
20 | /// Borrows the underlying C value mutably. |
21 | #[doc (hidden)] |
22 | #[inline ] |
23 | pub unsafe fn from_glib_ptr_borrow_mut<'a>( |
24 | ptr: *mut gobject_ffi::GTypeValueTable, |
25 | ) -> &'a mut Self { |
26 | &mut *(ptr as *mut Self) |
27 | } |
28 | } |
29 | |
30 | impl Default for TypeValueTable { |
31 | // rustdoc-stripper-ignore-next |
32 | /// Creates a new TypeValueTable with default value. |
33 | fn default() -> Self { |
34 | Self(gobject_ffi::GTypeValueTable { |
35 | value_init: None, |
36 | value_free: None, |
37 | value_copy: None, |
38 | value_peek_pointer: None, |
39 | collect_format: ::std::ptr::null(), |
40 | collect_value: None, |
41 | lcopy_format: ::std::ptr::null(), |
42 | lcopy_value: None, |
43 | }) |
44 | } |
45 | } |
46 | |