Skip to main content

CalamineSourceReader

Struct CalamineSourceReader 

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

Default SourceReader backed by calamine. Assumes the source is laid out as a single header row at row 1, followed by data rows. (xl3 0.x’s source_table = 1 convention.) The workbook is held as an in-memory byte buffer so the styles pass can re-open the same archive cheaply — and so a Vec<u8> host (browser/Node) and a file host share the exact same code path.

Implementations§

Source§

impl CalamineSourceReader

Source

pub fn open(path: &Path) -> Result<Self>

Source

pub fn open_bytes(bytes: Vec<u8>) -> Result<Self>

In-memory variant — the WASM convert() entry point feeds the data workbook in this way.

Source

pub fn first_sheet(&self) -> Option<String>

Convenience: when only one source is named in __config__, load the first non-empty sheet.

Source

pub fn resolve_sheet_name(&self, pattern: &str) -> Option<String>

Resolve a source_sheet configuration value to an actual sheet name in the workbook. Accepts:

  • exact name ("Data") — returned as-is iff present
  • prefix glob ("Data_*") — first sheet in workbook order whose name starts with the literal prefix (xl3 evaluation.md “Source Data Model”)

Trait Implementations§

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<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.