Skip to main content

SheetStreamReader

Struct SheetStreamReader 

Source
pub struct SheetStreamReader<'a, R: BufRead> { /* private fields */ }
Expand description

Forward-only streaming reader for worksheet XML.

Reads rows in batches without deserializing the entire worksheet into memory. The reader borrows the shared string table for resolving string cell references.

Implementations§

Source§

impl<'a, R: BufRead> SheetStreamReader<'a, R>

Source

pub fn new(source: R, sst: &'a SharedStringTable) -> Self

Create a new streaming reader over the given BufRead source.

sst is a reference to the shared string table for resolving shared string cell values. Optional configuration (row limit, date interpretation) is applied via the builder methods.

Source

pub fn row_limit(self, limit: Option<u32>) -> Self

Cap the number of rows produced by this reader. None means no limit (the default).

Source

pub fn date_promotion( self, interpretation: DateInterpretation, style_is_date: Vec<bool>, ) -> Self

Configure how date-formatted number cells are interpreted.

style_is_date is a per-style boolean produced by crate::style::compute_style_is_date; it is indexed by each cell’s s attribute. Empty vectors are equivalent to “no style was a date format”, which is the safe default.

Source

pub fn next_batch(&mut self, batch_size: usize) -> Result<Vec<StreamRow>>

Read the next batch of rows. Returns an empty Vec when there are no more rows to read.

Source

pub fn has_more(&self) -> bool

Returns true if there are potentially more rows to read.

Source

pub fn close(self)

Close the reader and release resources.

Auto Trait Implementations§

§

impl<'a, R> Freeze for SheetStreamReader<'a, R>
where R: Freeze,

§

impl<'a, R> RefUnwindSafe for SheetStreamReader<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for SheetStreamReader<'a, R>
where R: Send,

§

impl<'a, R> Sync for SheetStreamReader<'a, R>
where R: Sync,

§

impl<'a, R> Unpin for SheetStreamReader<'a, R>
where R: Unpin,

§

impl<'a, R> UnsafeUnpin for SheetStreamReader<'a, R>
where R: UnsafeUnpin,

§

impl<'a, R> UnwindSafe for SheetStreamReader<'a, R>
where R: UnwindSafe,

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.