@@ -69,6 +69,7 @@ use std::{
69
69
HashMap ,
70
70
} ,
71
71
convert:: TryFrom ,
72
+ fmt,
72
73
fs:: read,
73
74
path:: PathBuf ,
74
75
sync:: {
@@ -126,7 +127,7 @@ macro_rules! getter {
126
127
} } ;
127
128
}
128
129
129
- #[ derive( Clone ) ]
130
+ #[ derive( Debug , Clone ) ]
130
131
struct EventLoopContext {
131
132
main_thread_id : ThreadId ,
132
133
is_event_loop_running : Arc < AtomicBool > ,
@@ -146,6 +147,15 @@ pub struct GlobalShortcutManagerHandle {
146
147
listeners : GlobalShortcutListeners ,
147
148
}
148
149
150
+ impl fmt:: Debug for GlobalShortcutManagerHandle {
151
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
152
+ f. debug_struct ( "GlobalShortcutManagerHandle" )
153
+ . field ( "context" , & self . context )
154
+ . field ( "shortcuts" , & self . shortcuts )
155
+ . finish ( )
156
+ }
157
+ }
158
+
149
159
impl GlobalShortcutManager for GlobalShortcutManagerHandle {
150
160
fn is_registered ( & self , accelerator : & str ) -> Result < bool > {
151
161
let ( tx, rx) = channel ( ) ;
@@ -205,7 +215,7 @@ impl GlobalShortcutManager for GlobalShortcutManagerHandle {
205
215
}
206
216
}
207
217
208
- #[ derive( Clone ) ]
218
+ #[ derive( Debug , Clone ) ]
209
219
pub struct ClipboardManagerWrapper {
210
220
context : EventLoopContext ,
211
221
}
@@ -728,23 +738,23 @@ pub enum WebviewEvent {
728
738
}
729
739
730
740
#[ cfg( feature = "system-tray" ) ]
731
- #[ derive( Clone ) ]
741
+ #[ derive( Debug , Clone ) ]
732
742
pub enum TrayMessage {
733
743
UpdateItem ( u16 , menu:: MenuUpdate ) ,
734
744
UpdateIcon ( Icon ) ,
735
745
#[ cfg( target_os = "macos" ) ]
736
746
UpdateIconAsTemplate ( bool ) ,
737
747
}
738
748
739
- #[ derive( Clone ) ]
749
+ #[ derive( Debug , Clone ) ]
740
750
pub enum GlobalShortcutMessage {
741
751
IsRegistered ( Accelerator , Sender < bool > ) ,
742
752
Register ( Accelerator , Sender < Result < GlobalShortcutWrapper > > ) ,
743
753
Unregister ( GlobalShortcutWrapper , Sender < Result < ( ) > > ) ,
744
754
UnregisterAll ( Sender < Result < ( ) > > ) ,
745
755
}
746
756
747
- #[ derive( Clone ) ]
757
+ #[ derive( Debug , Clone ) ]
748
758
pub enum ClipboardMessage {
749
759
WriteText ( String , Sender < ( ) > ) ,
750
760
ReadText ( Sender < Option < String > > ) ,
@@ -780,8 +790,18 @@ struct DispatcherContext {
780
790
menu_event_listeners : MenuEventListeners ,
781
791
}
782
792
793
+ impl fmt:: Debug for DispatcherContext {
794
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
795
+ f. debug_struct ( "DispatcherContext" )
796
+ . field ( "main_thread_id" , & self . main_thread_id )
797
+ . field ( "is_event_loop_running" , & self . is_event_loop_running )
798
+ . field ( "proxy" , & self . proxy )
799
+ . finish ( )
800
+ }
801
+ }
802
+
783
803
/// The Tauri [`Dispatch`] for [`Wry`].
784
- #[ derive( Clone ) ]
804
+ #[ derive( Debug , Clone ) ]
785
805
pub struct WryDispatcher {
786
806
window_id : WindowId ,
787
807
context : DispatcherContext ,
@@ -1261,7 +1281,7 @@ pub struct Wry {
1261
1281
}
1262
1282
1263
1283
/// A handle to the Wry runtime.
1264
- #[ derive( Clone ) ]
1284
+ #[ derive( Debug , Clone ) ]
1265
1285
pub struct WryHandle {
1266
1286
dispatcher_context : DispatcherContext ,
1267
1287
}
0 commit comments