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
impl CalamineSourceReader
pub fn open(path: &Path) -> Result<Self>
Sourcepub fn open_bytes(bytes: Vec<u8>) -> Result<Self>
pub fn open_bytes(bytes: Vec<u8>) -> Result<Self>
In-memory variant — the WASM convert() entry point feeds the
data workbook in this way.
Sourcepub fn first_sheet(&self) -> Option<String>
pub fn first_sheet(&self) -> Option<String>
Convenience: when only one source is named in __config__, load
the first non-empty sheet.
Sourcepub fn resolve_sheet_name(&self, pattern: &str) -> Option<String>
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§
Source§impl SourceReader for CalamineSourceReader
impl SourceReader for CalamineSourceReader
fn read(&mut self, sheet: &str, table: &SourceTable) -> Result<SourceData>
Auto Trait Implementations§
impl Freeze for CalamineSourceReader
impl RefUnwindSafe for CalamineSourceReader
impl Send for CalamineSourceReader
impl Sync for CalamineSourceReader
impl Unpin for CalamineSourceReader
impl UnsafeUnpin for CalamineSourceReader
impl UnwindSafe for CalamineSourceReader
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