11mod bitmap;
22pub ( crate ) mod rfx;
33
4- use core:: { cmp, mem} ;
4+ use core:: { cmp, fmt , mem} ;
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 {
@@ -172,6 +182,12 @@ struct BitmapHandler {
172182 bitmap : BitmapEncoder ,
173183}
174184
185+ impl fmt:: Debug for BitmapHandler {
186+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
187+ f. debug_struct ( "BitmapHandler" ) . finish ( )
188+ }
189+ }
190+
175191impl BitmapHandler {
176192 fn new ( ) -> Self {
177193 Self {
@@ -200,6 +216,7 @@ impl BitmapUpdateHandler for BitmapHandler {
200216 }
201217}
202218
219+ #[ derive( Debug ) ]
203220struct RemoteFxHandler {
204221 remotefx : RfxEncoder ,
205222 codec_id : u8 ,
@@ -287,6 +304,14 @@ pub(crate) struct UpdateFragmenter<'a> {
287304 data : & ' a [ u8 ] ,
288305}
289306
307+ impl fmt:: Debug for UpdateFragmenter < ' _ > {
308+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
309+ f. debug_struct ( "UpdateFragmenter" )
310+ . field ( "len" , & self . data . len ( ) )
311+ . finish ( )
312+ }
313+ }
314+
290315impl < ' a > UpdateFragmenter < ' a > {
291316 pub ( crate ) fn new ( code : UpdateCode , data : & ' a [ u8 ] ) -> Self {
292317 Self { code, index : 0 , data }
0 commit comments