refactor(pdu): impl Debuf for ExtendedBitmapDataPdu

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2024-08-14 00:37:06 -04:00
committed by Benoît Cortier
parent 36a08292d5
commit aac0740d52
@@ -163,7 +163,7 @@ impl<'de> PduDecode<'de> for FrameMarkerPdu {
}
// TS_BITMAP_DATA_EX
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Clone, PartialEq, Eq)]
pub struct ExtendedBitmapDataPdu<'a> {
pub bpp: u8,
pub codec_id: u8,
@@ -173,6 +173,19 @@ pub struct ExtendedBitmapDataPdu<'a> {
pub data: &'a [u8],
}
impl std::fmt::Debug for ExtendedBitmapDataPdu<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ExtendedBitmapDataPdu")
.field("bpp", &self.bpp)
.field("codec_id", &self.codec_id)
.field("width", &self.width)
.field("height", &self.height)
.field("header", &self.header)
.field("data_len", &self.data.len())
.finish()
}
}
impl ExtendedBitmapDataPdu<'_> {
const NAME: &'static str = "TS_BITMAP_DATA_EX";
const FIXED_PART_SIZE: usize = 1 /* bpp */ + 1 /* flags */ + 1 /* reserved */ + 1 /* codecId */ + 2 /* width */ + 2 /* height */ + 4 /* len */;