Skip to main content

XmlBatchBuilder

Struct XmlBatchBuilder 

Source
pub struct XmlBatchBuilder { /* private fields */ }
Expand description

Builds Arrow batches from complete XML record elements.

Implementations§

Source§

impl XmlBatchBuilder

Source

pub fn new(schema: XmlSchema, batch_size: usize) -> Result<Self>

Creates a builder with a positive row limit.

Source

pub fn new_projected( schema: XmlSchema, batch_size: usize, projection: &[usize], ) -> Result<Self>

Selects columns in order; duplicate or invalid indices fail. Only selected fields are converted; an empty projection counts rows. XML syntax is always checked.

Source

pub fn append_xml(&mut self, input: &str) -> Result<()>

Appends a complete XML record. Errors leave pending rows unchanged.

Source

pub fn len(&self) -> usize

Pending row count.

Source

pub fn is_empty(&self) -> bool

Whether the batch is empty.

Source

pub fn is_full(&self) -> bool

Whether the row limit has been reached.

Source

pub fn schema(&self) -> SchemaRef

Projected output schema.

Source

pub fn flush(&mut self) -> Result<Option<RecordBatch>>

Flushes pending rows; returns None if empty.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.