pub struct SpectrumBatchBuilder { /* private fields */ }Expand description
Streaming builder that accumulates SpectrumRecords and produces a
single Arrow RecordBatch when finalized.
All rows in a batch share one mobility_array_kind value, recorded
once at construction. Push rows with push; call
finish to materialize the batch.
Implementations§
Source§impl SpectrumBatchBuilder
impl SpectrumBatchBuilder
Sourcepub fn new(mobility_kind: Option<MobilityArrayKind>) -> Self
pub fn new(mobility_kind: Option<MobilityArrayKind>) -> Self
Create a new builder. Pass the mobility_array_kind from the
source’s crate::RunMetadata so the resulting Arrow batch
carries the unit/CV interpretation alongside the data.
Sourcepub fn push(&mut self, rec: &SpectrumRecord)
pub fn push(&mut self, rec: &SpectrumRecord)
Append one spectrum row.
Sourcepub fn finish(self) -> Result<RecordBatch, ArrowError>
pub fn finish(self) -> Result<RecordBatch, ArrowError>
Materialize the accumulated rows into a RecordBatch.
Auto Trait Implementations§
impl Freeze for SpectrumBatchBuilder
impl RefUnwindSafe for SpectrumBatchBuilder
impl Send for SpectrumBatchBuilder
impl Sync for SpectrumBatchBuilder
impl Unpin for SpectrumBatchBuilder
impl UnsafeUnpin for SpectrumBatchBuilder
impl UnwindSafe for SpectrumBatchBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more