structured/record.rs
1//! Definitions to help handling CSV data as a set of records.
2
3use arrow::array::Array;
4use std::sync::Arc;
5
6/// A batch of multi-field data.
7#[derive(Clone)]
8pub struct Batch {
9 columns: Vec<Arc<dyn Array>>,
10}
11
12impl Batch {
13 #[must_use]
14 pub fn new(columns: Vec<Arc<dyn Array>>) -> Self {
15 Self { columns }
16 }
17
18 #[must_use]
19 pub fn columns(&self) -> &[Arc<dyn Array>] {
20 self.columns.as_slice()
21 }
22}