11mod bitmap;
22pub ( crate ) mod rfx;
33
4- use core:: cmp;
4+ use core:: { cmp, fmt } ;
55
66use anyhow:: { Context , Result } ;
77use ironrdp_core:: { Encode , WriteCursor } ;
@@ -32,6 +32,14 @@ pub(crate) struct UpdateEncoder {
3232 bitmap_updater : BitmapUpdater ,
3333}
3434
35+ impl fmt:: Debug for UpdateEncoder {
36+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
37+ f. debug_struct ( "UpdateEncoder" )
38+ . field ( "bitmap_update" , & self . bitmap_updater )
39+ . finish ( )
40+ }
41+ }
42+
3543impl UpdateEncoder {
3644 pub ( crate ) fn new ( surface_flags : CmdFlags , remotefx : Option < ( EntropyBits , u8 ) > ) -> Self {
3745 let pdu_encoder = PduEncoder :: new ( ) ;
@@ -118,6 +126,7 @@ impl UpdateEncoder {
118126 }
119127}
120128
129+ #[ derive( Debug ) ]
121130enum BitmapUpdater {
122131 None ( NoneHandler ) ,
123132 Bitmap ( BitmapHandler ) ,
@@ -138,6 +147,7 @@ trait BitmapUpdateHandler {
138147 fn handle < ' a > ( & mut self , bitmap : BitmapUpdate , encoder : & ' a mut PduEncoder ) -> Result < UpdateFragmenter < ' a > > ;
139148}
140149
150+ #[ derive( Debug ) ]
141151struct NoneHandler ;
142152
143153impl BitmapUpdateHandler for NoneHandler {
@@ -156,6 +166,12 @@ struct BitmapHandler {
156166 bitmap : BitmapEncoder ,
157167}
158168
169+ impl fmt:: Debug for BitmapHandler {
170+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
171+ f. debug_struct ( "BitmapHandler" ) . finish ( )
172+ }
173+ }
174+
159175impl BitmapHandler {
160176 fn new ( ) -> Self {
161177 Self {
@@ -184,6 +200,7 @@ impl BitmapUpdateHandler for BitmapHandler {
184200 }
185201}
186202
203+ #[ derive( Debug ) ]
187204struct RemoteFxHandler {
188205 remotefx : RfxEncoder ,
189206 codec_id : u8 ,
@@ -284,6 +301,14 @@ pub(crate) struct UpdateFragmenter<'a> {
284301 data : & ' a [ u8 ] ,
285302}
286303
304+ impl fmt:: Debug for UpdateFragmenter < ' _ > {
305+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
306+ f. debug_struct ( "UpdateFragmenter" )
307+ . field ( "len" , & self . data . len ( ) )
308+ . finish ( )
309+ }
310+ }
311+
287312impl < ' a > UpdateFragmenter < ' a > {
288313 pub ( crate ) fn new ( code : UpdateCode , data : & ' a [ u8 ] ) -> Self {
289314 Self { code, index : 0 , data }
0 commit comments