@@ -69,6 +69,7 @@ use std::{
6969 HashMap ,
7070 } ,
7171 convert:: TryFrom ,
72+ fmt,
7273 fs:: read,
7374 path:: PathBuf ,
7475 sync:: {
@@ -126,7 +127,7 @@ macro_rules! getter {
126127 } } ;
127128}
128129
129- #[ derive( Clone ) ]
130+ #[ derive( Debug , Clone ) ]
130131struct EventLoopContext {
131132 main_thread_id : ThreadId ,
132133 is_event_loop_running : Arc < AtomicBool > ,
@@ -146,6 +147,15 @@ pub struct GlobalShortcutManagerHandle {
146147 listeners : GlobalShortcutListeners ,
147148}
148149
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+
149159impl GlobalShortcutManager for GlobalShortcutManagerHandle {
150160 fn is_registered ( & self , accelerator : & str ) -> Result < bool > {
151161 let ( tx, rx) = channel ( ) ;
@@ -205,7 +215,7 @@ impl GlobalShortcutManager for GlobalShortcutManagerHandle {
205215 }
206216}
207217
208- #[ derive( Clone ) ]
218+ #[ derive( Debug , Clone ) ]
209219pub struct ClipboardManagerWrapper {
210220 context : EventLoopContext ,
211221}
@@ -728,23 +738,23 @@ pub enum WebviewEvent {
728738}
729739
730740#[ cfg( feature = "system-tray" ) ]
731- #[ derive( Clone ) ]
741+ #[ derive( Debug , Clone ) ]
732742pub enum TrayMessage {
733743 UpdateItem ( u16 , menu:: MenuUpdate ) ,
734744 UpdateIcon ( Icon ) ,
735745 #[ cfg( target_os = "macos" ) ]
736746 UpdateIconAsTemplate ( bool ) ,
737747}
738748
739- #[ derive( Clone ) ]
749+ #[ derive( Debug , Clone ) ]
740750pub enum GlobalShortcutMessage {
741751 IsRegistered ( Accelerator , Sender < bool > ) ,
742752 Register ( Accelerator , Sender < Result < GlobalShortcutWrapper > > ) ,
743753 Unregister ( GlobalShortcutWrapper , Sender < Result < ( ) > > ) ,
744754 UnregisterAll ( Sender < Result < ( ) > > ) ,
745755}
746756
747- #[ derive( Clone ) ]
757+ #[ derive( Debug , Clone ) ]
748758pub enum ClipboardMessage {
749759 WriteText ( String , Sender < ( ) > ) ,
750760 ReadText ( Sender < Option < String > > ) ,
@@ -780,8 +790,18 @@ struct DispatcherContext {
780790 menu_event_listeners : MenuEventListeners ,
781791}
782792
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+
783803/// The Tauri [`Dispatch`] for [`Wry`].
784- #[ derive( Clone ) ]
804+ #[ derive( Debug , Clone ) ]
785805pub struct WryDispatcher {
786806 window_id : WindowId ,
787807 context : DispatcherContext ,
@@ -1261,7 +1281,7 @@ pub struct Wry {
12611281}
12621282
12631283/// A handle to the Wry runtime.
1264- #[ derive( Clone ) ]
1284+ #[ derive( Debug , Clone ) ]
12651285pub struct WryHandle {
12661286 dispatcher_context : DispatcherContext ,
12671287}
0 commit comments