1
1
mod bitmap;
2
2
pub ( crate ) mod rfx;
3
3
4
- use core:: cmp;
4
+ use core:: { cmp, fmt } ;
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 {
@@ -156,6 +166,12 @@ struct BitmapHandler {
156
166
bitmap : BitmapEncoder ,
157
167
}
158
168
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
+
159
175
impl BitmapHandler {
160
176
fn new ( ) -> Self {
161
177
Self {
@@ -184,6 +200,7 @@ impl BitmapUpdateHandler for BitmapHandler {
184
200
}
185
201
}
186
202
203
+ #[ derive( Debug ) ]
187
204
struct RemoteFxHandler {
188
205
remotefx : RfxEncoder ,
189
206
codec_id : u8 ,
@@ -284,6 +301,14 @@ pub(crate) struct UpdateFragmenter<'a> {
284
301
data : & ' a [ u8 ] ,
285
302
}
286
303
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
+
287
312
impl < ' a > UpdateFragmenter < ' a > {
288
313
pub ( crate ) fn new ( code : UpdateCode , data : & ' a [ u8 ] ) -> Self {
289
314
Self { code, index : 0 , data }
0 commit comments