1
1
mod bitmap;
2
2
pub ( crate ) mod rfx;
3
3
4
- use core:: { cmp, mem} ;
4
+ use core:: { cmp, fmt , mem} ;
5
5
6
6
use anyhow:: { Context , Result } ;
7
7
use ironrdp_core:: { Encode , WriteCursor } ;
@@ -32,6 +32,14 @@ pub(crate) struct UpdateEncoder {
32
32
bitmap_updater : BitmapUpdater ,
33
33
}
34
34
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
+
35
43
impl UpdateEncoder {
36
44
pub ( crate ) fn new ( surface_flags : CmdFlags , remotefx : Option < ( EntropyBits , u8 ) > ) -> Self {
37
45
let pdu_encoder = PduEncoder :: new ( ) ;
@@ -118,6 +126,7 @@ impl UpdateEncoder {
118
126
}
119
127
}
120
128
129
+ #[ derive( Debug ) ]
121
130
enum BitmapUpdater {
122
131
None ( NoneHandler ) ,
123
132
Bitmap ( BitmapHandler ) ,
@@ -138,6 +147,7 @@ trait BitmapUpdateHandler {
138
147
fn handle < ' a > ( & mut self , bitmap : BitmapUpdate , encoder : & ' a mut PduEncoder ) -> Result < UpdateFragmenter < ' a > > ;
139
148
}
140
149
150
+ #[ derive( Debug ) ]
141
151
struct NoneHandler ;
142
152
143
153
impl BitmapUpdateHandler for NoneHandler {
@@ -172,6 +182,12 @@ struct BitmapHandler {
172
182
bitmap : BitmapEncoder ,
173
183
}
174
184
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
+
175
191
impl BitmapHandler {
176
192
fn new ( ) -> Self {
177
193
Self {
@@ -200,6 +216,7 @@ impl BitmapUpdateHandler for BitmapHandler {
200
216
}
201
217
}
202
218
219
+ #[ derive( Debug ) ]
203
220
struct RemoteFxHandler {
204
221
remotefx : RfxEncoder ,
205
222
codec_id : u8 ,
@@ -287,6 +304,14 @@ pub(crate) struct UpdateFragmenter<'a> {
287
304
data : & ' a [ u8 ] ,
288
305
}
289
306
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
+
290
315
impl < ' a > UpdateFragmenter < ' a > {
291
316
pub ( crate ) fn new ( code : UpdateCode , data : & ' a [ u8 ] ) -> Self {
292
317
Self { code, index : 0 , data }
0 commit comments