MCPcopy Create free account
hub / github.com/apache/arrow-rs / try_build

Method try_build

arrow-avro/src/reader/async_reader/builder.rs:189–200  ·  view source on GitHub ↗

Build the asynchronous Avro reader with the provided parameters. This reads the header first to initialize the reader state.

(mut self)

Source from the content-addressed store, hash-verified

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 ///

Calls 2

build_with_headerMethod · 0.80
read_header_infoFunction · 0.70