pub struct ArrayBuilder { /* private fields */ }Expand description
Construct arrays by pushing individual records
It can be constructed via
It supports array construction via
Usage:
use serde_arrow::ArrayBuilder;
let mut builder = ArrayBuilder::from_arrow(&fields)?;
// push multiple items
builder.extend(&items)?;
// push a single items
builder.push(&item)?;
// build the arrays
let arrays = builder.to_arrow()?;Implementations§
Source§impl ArrayBuilder
impl ArrayBuilder
Sourcepub fn new(schema: SerdeArrowSchema) -> Result<Self>
pub fn new(schema: SerdeArrowSchema) -> Result<Self>
Construct an array builder from an SerdeArrowSchema
Source§impl ArrayBuilder
impl ArrayBuilder
Source§impl ArrayBuilder
Support arrow (requires one of the arrow-* features)
impl ArrayBuilder
Support arrow (requires one of the arrow-* features)
Sourcepub fn from_arrow(fields: &[FieldRef]) -> Result<Self>
pub fn from_arrow(fields: &[FieldRef]) -> Result<Self>
Build an ArrayBuilder from arrow fields (requires one of the
arrow-* features)
Sourcepub fn to_arrow(&mut self) -> Result<Vec<ArrayRef>>
pub fn to_arrow(&mut self) -> Result<Vec<ArrayRef>>
Construct arrow arrays and reset the builder (requires one of the
arrow-* features)
Sourcepub fn to_record_batch(&mut self) -> Result<RecordBatch>
pub fn to_record_batch(&mut self) -> Result<RecordBatch>
Construct a RecordBatch and reset the builder (requires one of the
arrow-* features)
Source§impl ArrayBuilder
Support arrow2 (requires one of the arrow2-* features)
impl ArrayBuilder
Support arrow2 (requires one of the arrow2-* features)
Sourcepub fn from_arrow2(fields: &[ArrowField]) -> Result<Self>
pub fn from_arrow2(fields: &[ArrowField]) -> Result<Self>
Build an ArrayBuilder from arrow2 fields (requires one of the
arrow2-* features)
Source§impl ArrayBuilder
impl ArrayBuilder
Sourcepub fn from_marrow(fields: &[Field]) -> Result<Self>
pub fn from_marrow(fields: &[Field]) -> Result<Self>
Build an array builder from marrow::Fields
Trait Implementations§
Source§impl AsMut<ArrayBuilder> for ArrayBuilder
impl AsMut<ArrayBuilder> for ArrayBuilder
Source§fn as_mut(&mut self) -> &mut ArrayBuilder
fn as_mut(&mut self) -> &mut ArrayBuilder
Converts this type into a mutable reference of the (usually inferred) input type.
Source§impl AsRef<ArrayBuilder> for ArrayBuilder
impl AsRef<ArrayBuilder> for ArrayBuilder
Source§fn as_ref(&self) -> &ArrayBuilder
fn as_ref(&self) -> &ArrayBuilder
Converts this type into a shared reference of the (usually inferred) input type.
Auto Trait Implementations§
impl Freeze for ArrayBuilder
impl RefUnwindSafe for ArrayBuilder
impl Send for ArrayBuilder
impl Sync for ArrayBuilder
impl Unpin for ArrayBuilder
impl UnwindSafe for ArrayBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more