This repository was archived by the owner on Jun 8, 2021. It is now read-only.
File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1158,6 +1158,7 @@ macro_rules! glib_object_wrapper {
1158
1158
1159
1159
( @class_impl $name: ident, $ffi_class_name: path, $rust_class_name: ident) => {
1160
1160
#[ repr( C ) ]
1161
+ #[ derive( Debug ) ]
1161
1162
pub struct $rust_class_name( $ffi_class_name) ;
1162
1163
1163
1164
unsafe impl $crate:: object:: IsClassFor for $rust_class_name {
@@ -1916,6 +1917,7 @@ glib_wrapper! {
1916
1917
}
1917
1918
}
1918
1919
1920
+ #[ derive( Debug ) ]
1919
1921
pub struct WeakRef < T : ObjectType > ( Box < gobject_sys:: GWeakRef > , PhantomData < * const T > ) ;
1920
1922
1921
1923
impl < T : ObjectType > WeakRef < T > {
@@ -1979,6 +1981,7 @@ unsafe impl<T: ObjectType + Send + Sync> Send for WeakRef<T> {}
1979
1981
/// Trying to upgrade the weak reference from another thread than the one
1980
1982
/// where it was created on will panic but dropping or cloning can be done
1981
1983
/// safely from any thread.
1984
+ #[ derive( Debug ) ]
1982
1985
pub struct SendWeakRef < T : ObjectType > ( WeakRef < T > , Option < usize > ) ;
1983
1986
1984
1987
impl < T : ObjectType > SendWeakRef < T > {
@@ -2029,6 +2032,7 @@ impl<T: ObjectType> From<WeakRef<T>> for SendWeakRef<T> {
2029
2032
unsafe impl < T : ObjectType > Sync for SendWeakRef < T > { }
2030
2033
unsafe impl < T : ObjectType > Send for SendWeakRef < T > { }
2031
2034
2035
+ #[ derive( Debug ) ]
2032
2036
pub struct BindingBuilder < ' a > {
2033
2037
source : & ' a ObjectRef ,
2034
2038
source_property : & ' a str ,
Original file line number Diff line number Diff line change 9
9
use super :: prelude:: * ;
10
10
use object:: ObjectType ;
11
11
12
+ use std:: fmt;
12
13
use std:: ops;
13
14
14
15
/// A simple instance struct that does not store any additional data.
@@ -17,6 +18,17 @@ pub struct InstanceStruct<T: ObjectSubclass> {
17
18
parent : <T :: ParentType as ObjectType >:: GlibType ,
18
19
}
19
20
21
+ impl < T : ObjectSubclass > fmt:: Debug for InstanceStruct < T >
22
+ where
23
+ <T :: ParentType as ObjectType >:: GlibType : fmt:: Debug ,
24
+ {
25
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
26
+ f. debug_struct ( "InstanceStruct" )
27
+ . field ( "parent" , & self . parent )
28
+ . finish ( )
29
+ }
30
+ }
31
+
20
32
unsafe impl < T : ObjectSubclass > super :: types:: InstanceStruct for InstanceStruct < T > {
21
33
type Type = T ;
22
34
}
@@ -28,6 +40,17 @@ pub struct ClassStruct<T: ObjectSubclass> {
28
40
parent_class : <T :: ParentType as ObjectType >:: GlibClassType ,
29
41
}
30
42
43
+ impl < T : ObjectSubclass > fmt:: Debug for ClassStruct < T >
44
+ where
45
+ <T :: ParentType as ObjectType >:: GlibClassType : fmt:: Debug ,
46
+ {
47
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
48
+ f. debug_struct ( "InstanceStruct" )
49
+ . field ( "parent_class" , & self . parent_class )
50
+ . finish ( )
51
+ }
52
+ }
53
+
31
54
unsafe impl < T : ObjectSubclass > super :: types:: ClassStruct for ClassStruct < T > {
32
55
type Type = T ;
33
56
}
You can’t perform that action at this time.
0 commit comments