@@ -77,6 +77,17 @@ impl ClientJsonrpcRequest {
7777 }
7878}
7979
80+ /// Formats the ClientJsonrpcRequest as a JSON string.
81+ impl Display for ClientJsonrpcRequest {
82+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
83+ write ! (
84+ f,
85+ "{}" ,
86+ serde_json:: to_string( self ) . unwrap_or_else( |err| format!( "Serialization error: {}" , err) )
87+ )
88+ }
89+ }
90+
8091//*************************//
8192//** Request From Client **//
8293//*************************//
@@ -150,6 +161,17 @@ impl ClientJsonrpcNotification {
150161 }
151162}
152163
164+ /// Formats the ClientJsonrpcNotification as a JSON string.
165+ impl Display for ClientJsonrpcNotification {
166+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
167+ write ! (
168+ f,
169+ "{}" ,
170+ serde_json:: to_string( self ) . unwrap_or_else( |err| format!( "Serialization error: {}" , err) )
171+ )
172+ }
173+ }
174+
153175//*******************************//
154176//** NotificationFromClient **//
155177//*******************************//
@@ -210,6 +232,17 @@ impl ClientJsonrpcResponse {
210232 }
211233}
212234
235+ /// Formats the ClientJsonrpcResponse as a JSON string.
236+ impl Display for ClientJsonrpcResponse {
237+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
238+ write ! (
239+ f,
240+ "{}" ,
241+ serde_json:: to_string( self ) . unwrap_or_else( |err| format!( "Serialization error: {}" , err) )
242+ )
243+ }
244+ }
245+
213246//*******************************//
214247//** ResultFromClient **//
215248//*******************************//
@@ -331,6 +364,16 @@ impl ServerJsonrpcRequest {
331364 }
332365}
333366
367+ /// Formats the ServerJsonrpcRequest as a JSON string.
368+ impl Display for ServerJsonrpcRequest {
369+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
370+ write ! (
371+ f,
372+ "{}" ,
373+ serde_json:: to_string( self ) . unwrap_or_else( |err| format!( "Serialization error: {}" , err) )
374+ )
375+ }
376+ }
334377//*************************//
335378//** Request From Server **//
336379//*************************//
@@ -404,6 +447,16 @@ impl ServerJsonrpcNotification {
404447 }
405448}
406449
450+ /// Formats the ServerJsonrpcNotification as a JSON string.
451+ impl Display for ServerJsonrpcNotification {
452+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
453+ write ! (
454+ f,
455+ "{}" ,
456+ serde_json:: to_string( self ) . unwrap_or_else( |err| format!( "Serialization error: {}" , err) )
457+ )
458+ }
459+ }
407460//*******************************//
408461//** NotificationFromServer **//
409462//*******************************//
@@ -464,6 +517,17 @@ impl ServerJsonrpcResponse {
464517 }
465518}
466519
520+ /// Formats the ServerJsonrpcResponse as a JSON string.
521+ impl Display for ServerJsonrpcResponse {
522+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
523+ write ! (
524+ f,
525+ "{}" ,
526+ serde_json:: to_string( self ) . unwrap_or_else( |err| format!( "Serialization error: {}" , err) )
527+ )
528+ }
529+ }
530+
467531//*******************************//
468532//** ResultFromServer **//
469533//*******************************//
@@ -511,6 +575,21 @@ impl<'de> serde::Deserialize<'de> for ResultFromServer {
511575 }
512576}
513577
578+ //***************************//
579+ //** impl for JsonrpcError **//
580+ //***************************//
581+
582+ /// Formats the ServerJsonrpcResponse as a JSON string.
583+ impl Display for JsonrpcError {
584+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
585+ write ! (
586+ f,
587+ "{}" ,
588+ serde_json:: to_string( self ) . unwrap_or_else( |err| format!( "Serialization error: {}" , err) )
589+ )
590+ }
591+ }
592+
514593/// BEGIN AUTO GENERATED
515594impl :: serde:: Serialize for ClientJsonrpcRequest {
516595 fn serialize < S > ( & self , serializer : S ) -> std:: result:: Result < S :: Ok , S :: Error >
0 commit comments