11use crate :: { Reader , Tag , TagTrait , TagType , TagTypeId } ;
22
3+ use core:: fmt:: Debug ;
34use core:: mem:: size_of;
45use core:: slice;
56use derive_more:: Display ;
@@ -17,7 +18,7 @@ const METADATA_SIZE: usize = size_of::<TagTypeId>()
1718 + 2 * size_of :: < u8 > ( ) ;
1819
1920/// The VBE Framebuffer information Tag.
20- #[ derive( Debug , PartialEq , Eq , ptr_meta:: Pointee ) ]
21+ #[ derive( Eq , ptr_meta:: Pointee ) ]
2122#[ repr( C , packed) ]
2223pub struct FramebufferTag {
2324 typ : TagTypeId ,
@@ -156,6 +157,35 @@ impl StructAsBytes for FramebufferTag {
156157 }
157158}
158159
160+ impl Debug for FramebufferTag {
161+ fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
162+ f. debug_struct ( "FramebufferTag" )
163+ . field ( "typ" , & { self . typ } )
164+ . field ( "size" , & { self . size } )
165+ . field ( "buffer_type" , & self . buffer_type ( ) )
166+ . field ( "address" , & { self . address } )
167+ . field ( "pitch" , & { self . pitch } )
168+ . field ( "width" , & { self . width } )
169+ . field ( "height" , & { self . height } )
170+ . field ( "bpp" , & self . bpp )
171+ . finish ( )
172+ }
173+ }
174+
175+ impl PartialEq for FramebufferTag {
176+ fn eq ( & self , other : & Self ) -> bool {
177+ ( { self . typ } == { other. typ }
178+ && { self . size } == { other. size }
179+ && { self . address } == { other. address }
180+ && { self . pitch } == { other. pitch }
181+ && { self . width } == { other. width }
182+ && { self . height } == { other. height }
183+ && { self . bpp } == { other. bpp }
184+ && { self . type_no } == { other. type_no }
185+ && self . buffer == other. buffer )
186+ }
187+ }
188+
159189/// Helper struct for [`FramebufferType`].
160190#[ derive( Debug , PartialEq , Eq ) ]
161191#[ repr( u8 ) ]
0 commit comments