File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1515//! A convenience class for reading binary data
1616
1717use binaryninjacore_sys:: * ;
18+ use std:: fmt:: Debug ;
1819
1920use crate :: binary_view:: { BinaryView , BinaryViewBase } ;
2021use crate :: Endianness ;
@@ -87,6 +88,16 @@ impl BinaryReader {
8788 }
8889}
8990
91+ impl Debug for BinaryReader {
92+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
93+ f. debug_struct ( "BinaryReader" )
94+ . field ( "offset" , & self . offset ( ) )
95+ . field ( "virtual_base" , & self . virtual_base ( ) )
96+ . field ( "endianness" , & self . endianness ( ) )
97+ . finish ( )
98+ }
99+ }
100+
90101impl Seek for BinaryReader {
91102 /// Seek to the specified position.
92103 fn seek ( & mut self , pos : SeekFrom ) -> std:: io:: Result < u64 > {
Original file line number Diff line number Diff line change 1515//! A convenience class for writing binary data
1616
1717use binaryninjacore_sys:: * ;
18+ use std:: fmt:: Debug ;
1819
1920use crate :: binary_view:: { BinaryView , BinaryViewBase } ;
2021use crate :: Endianness ;
@@ -68,6 +69,15 @@ impl BinaryWriter {
6869 }
6970}
7071
72+ impl Debug for BinaryWriter {
73+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
74+ f. debug_struct ( "BinaryWriter" )
75+ . field ( "offset" , & self . offset ( ) )
76+ . field ( "endianness" , & self . endianness ( ) )
77+ . finish ( )
78+ }
79+ }
80+
7181impl Seek for BinaryWriter {
7282 /// Seek to the specified position.
7383 fn seek ( & mut self , pos : SeekFrom ) -> std:: io:: Result < u64 > {
You can’t perform that action at this time.
0 commit comments