@@ -25,13 +25,23 @@ use std::{cmp::Ordering, mem};
2525
2626// struct Block, aligned to 8
2727#[ repr( C , align( 8 ) ) ]
28- #[ derive( Clone , Copy , Debug , PartialEq ) ]
28+ #[ derive( Clone , Copy , PartialEq ) ]
2929pub struct Block {
3030 offset_ : i64 ,
3131 metaDataLength_ : i32 ,
3232 padding0__ : u32 ,
3333 bodyLength_ : i64 ,
3434} // pub struct Block
35+ impl std:: fmt:: Debug for Block {
36+ fn fmt ( & self , f : & mut std:: fmt:: Formatter ) -> std:: fmt:: Result {
37+ f. debug_struct ( "Block" )
38+ . field ( "offset" , & self . offset ( ) )
39+ . field ( "metaDataLength" , & self . metaDataLength ( ) )
40+ . field ( "bodyLength" , & self . bodyLength ( ) )
41+ . finish ( )
42+ }
43+ }
44+
3545impl flatbuffers:: SafeSliceAccess for Block { }
3646impl < ' a > flatbuffers:: Follow < ' a > for Block {
3747 type Inner = & ' a Block ;
@@ -52,7 +62,7 @@ impl<'b> flatbuffers::Push for Block {
5262 #[ inline]
5363 fn push ( & self , dst : & mut [ u8 ] , _rest : & [ u8 ] ) {
5464 let src = unsafe {
55- std:: slice:: from_raw_parts ( self as * const Block as * const u8 , Self :: size ( ) )
65+ :: std:: slice:: from_raw_parts ( self as * const Block as * const u8 , Self :: size ( ) )
5666 } ;
5767 dst. copy_from_slice ( src) ;
5868 }
@@ -63,14 +73,14 @@ impl<'b> flatbuffers::Push for &'b Block {
6373 #[ inline]
6474 fn push ( & self , dst : & mut [ u8 ] , _rest : & [ u8 ] ) {
6575 let src = unsafe {
66- std:: slice:: from_raw_parts ( * self as * const Block as * const u8 , Self :: size ( ) )
76+ :: std:: slice:: from_raw_parts ( * self as * const Block as * const u8 , Self :: size ( ) )
6777 } ;
6878 dst. copy_from_slice ( src) ;
6979 }
7080}
7181
7282impl Block {
73- pub fn new < ' a > ( _offset : i64 , _metaDataLength : i32 , _bodyLength : i64 ) -> Self {
83+ pub fn new ( _offset : i64 , _metaDataLength : i32 , _bodyLength : i64 ) -> Self {
7484 Block {
7585 offset_ : _offset. to_little_endian ( ) ,
7686 metaDataLength_ : _metaDataLength. to_little_endian ( ) ,
@@ -80,22 +90,22 @@ impl Block {
8090 }
8191 }
8292 /// Index to the start of the RecordBlock (note this is past the Message header)
83- pub fn offset < ' a > ( & ' a self ) -> i64 {
93+ pub fn offset ( & self ) -> i64 {
8494 self . offset_ . from_little_endian ( )
8595 }
8696 /// Length of the metadata
87- pub fn metaDataLength < ' a > ( & ' a self ) -> i32 {
97+ pub fn metaDataLength ( & self ) -> i32 {
8898 self . metaDataLength_ . from_little_endian ( )
8999 }
90100 /// Length of the data (this is aligned so there can be a gap between this and
91101 /// the metadata).
92- pub fn bodyLength < ' a > ( & ' a self ) -> i64 {
102+ pub fn bodyLength ( & self ) -> i64 {
93103 self . bodyLength_ . from_little_endian ( )
94104 }
95105}
96106
97107pub enum FooterOffset { }
98- #[ derive( Copy , Clone , Debug , PartialEq ) ]
108+ #[ derive( Copy , Clone , PartialEq ) ]
99109
100110/// ----------------------------------------------------------------------
101111/// Arrow File metadata
@@ -109,7 +119,7 @@ impl<'a> flatbuffers::Follow<'a> for Footer<'a> {
109119 #[ inline]
110120 fn follow ( buf : & ' a [ u8 ] , loc : usize ) -> Self :: Inner {
111121 Self {
112- _tab : flatbuffers:: Table { buf : buf , loc : loc } ,
122+ _tab : flatbuffers:: Table { buf, loc } ,
113123 }
114124 }
115125}
@@ -280,6 +290,17 @@ impl<'a: 'b, 'b> FooterBuilder<'a, 'b> {
280290 }
281291}
282292
293+ impl std:: fmt:: Debug for Footer < ' _ > {
294+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
295+ let mut ds = f. debug_struct ( "Footer" ) ;
296+ ds. field ( "version" , & self . version ( ) ) ;
297+ ds. field ( "schema" , & self . schema ( ) ) ;
298+ ds. field ( "dictionaries" , & self . dictionaries ( ) ) ;
299+ ds. field ( "recordBatches" , & self . recordBatches ( ) ) ;
300+ ds. field ( "custom_metadata" , & self . custom_metadata ( ) ) ;
301+ ds. finish ( )
302+ }
303+ }
283304#[ inline]
284305pub fn get_root_as_footer < ' a > ( buf : & ' a [ u8 ] ) -> Footer < ' a > {
285306 flatbuffers:: get_root :: < Footer < ' a > > ( buf)
0 commit comments