@@ -37,7 +37,7 @@ const DEFAULT_CAPACITY: usize = 1024;
3737
3838/// Decodes avro encoded data into [`RecordBatch`]
3939#[ derive( Debug ) ]
40- pub struct RecordDecoder {
40+ pub ( crate ) struct RecordDecoder {
4141 schema : SchemaRef ,
4242 fields : Vec < Decoder > ,
4343 use_utf8view : bool ,
@@ -46,7 +46,7 @@ pub struct RecordDecoder {
4646
4747impl RecordDecoder {
4848 /// Create a new [`RecordDecoder`] from the provided [`AvroDataType`] with default options
49- pub fn try_new ( data_type : & AvroDataType ) -> Result < Self , ArrowError > {
49+ pub ( crate ) fn try_new ( data_type : & AvroDataType ) -> Result < Self , ArrowError > {
5050 Self :: try_new_with_options ( data_type, false , false )
5151 }
5252
@@ -62,7 +62,7 @@ impl RecordDecoder {
6262 ///
6363 /// # Errors
6464 /// This function will return an error if the provided `data_type` is not a `Record`.
65- pub fn try_new_with_options (
65+ pub ( crate ) fn try_new_with_options (
6666 data_type : & AvroDataType ,
6767 use_utf8view : bool ,
6868 strict_mode : bool ,
@@ -80,12 +80,13 @@ impl RecordDecoder {
8080 }
8181 }
8282
83- pub fn schema ( & self ) -> & SchemaRef {
83+ /// Returns the decoder's `SchemaRef`
84+ pub ( crate ) fn schema ( & self ) -> & SchemaRef {
8485 & self . schema
8586 }
8687
8788 /// Decode `count` records from `buf`
88- pub fn decode ( & mut self , buf : & [ u8 ] , count : usize ) -> Result < usize , ArrowError > {
89+ pub ( crate ) fn decode ( & mut self , buf : & [ u8 ] , count : usize ) -> Result < usize , ArrowError > {
8990 let mut cursor = AvroCursor :: new ( buf) ;
9091 for _ in 0 ..count {
9192 for field in & mut self . fields {
@@ -96,7 +97,7 @@ impl RecordDecoder {
9697 }
9798
9899 /// Flush the decoded records into a [`RecordBatch`]
99- pub fn flush ( & mut self ) -> Result < RecordBatch , ArrowError > {
100+ pub ( crate ) fn flush ( & mut self ) -> Result < RecordBatch , ArrowError > {
100101 let arrays = self
101102 . fields
102103 . iter_mut ( )
0 commit comments