pub trait RecordBatchBuffer {
// Required methods
fn len(&self) -> usize;
fn drain_to_record_batch(&mut self) -> Result<RecordBatch, ArrowError>;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
Trait for buffer types that can produce Arrow RecordBatches.
Auto-implemented by #[derive(RecordBatchRow)] from
monarch_record_batch_macros.
Required Methods§
Sourcefn drain_to_record_batch(&mut self) -> Result<RecordBatch, ArrowError>
fn drain_to_record_batch(&mut self) -> Result<RecordBatch, ArrowError>
Drain buffered rows into a [RecordBatch].
After this call the buffer is empty (fields are consumed via
std::mem::take). The only failure mode is Arrow schema/batch
construction, so the error type is [ArrowError] rather than
a catch-all.