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

Method read

arrow-csv/src/reader/mod.rs:527–543  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

525
526impl<R: BufRead> BufReader<R> {
527 fn read(&mut self) -> Result<Option<RecordBatch>, ArrowError> {
528 loop {
529 let buf = self.reader.fill_buf()?;
530 let decoded = self.decoder.decode(buf)?;
531 self.reader.consume(decoded);
532 // Yield if decoded no bytes or the decoder is full
533 //
534 // The capacity check avoids looping around and potentially
535 // blocking reading data in fill_buf that isn't needed
536 // to flush the next batch
537 if decoded == 0 || self.decoder.capacity() == 0 {
538 break;
539 }
540 }
541
542 self.decoder.flush()
543 }
544}
545
546impl<R: BufRead> Iterator for BufReader<R> {

Callers 4

get_temp_fileFunction · 0.45
nextMethod · 0.45
do_getMethod · 0.45
mainFunction · 0.45

Calls 5

fill_bufMethod · 0.45
decodeMethod · 0.45
consumeMethod · 0.45
capacityMethod · 0.45
flushMethod · 0.45

Tested by 1

get_temp_fileFunction · 0.36