Build the asynchronous Avro reader with the provided parameters. This reads the header first to initialize the reader state.
(mut self)
| 187 | /// Build the asynchronous Avro reader with the provided parameters. |
| 188 | /// This reads the header first to initialize the reader state. |
| 189 | pub async fn try_build(mut self) -> Result<AsyncAvroFileReader<R>, AvroError> { |
| 190 | if self.file_size == 0 { |
| 191 | return Err(AvroError::InvalidArgument("File size cannot be 0".into())); |
| 192 | } |
| 193 | |
| 194 | // Start by reading the header from the beginning of the avro file |
| 195 | // take the writer schema from the header |
| 196 | let header_info = |
| 197 | read_header_info(&mut self.reader, self.file_size, self.header_size_hint).await?; |
| 198 | |
| 199 | self.build_with_header(header_info) |
| 200 | } |
| 201 | |
| 202 | /// Build the asynchronous Avro reader with the provided header. |
| 203 | /// |