Skip to main content

Reader

Trait Reader 

Source
pub trait Reader: Send + Sync {
    // Required methods
    fn extensions(&self) -> &[&'static str];
    fn read(&self, path: &Path, options: &ReadOptions) -> Result<Table>;

    // Provided method
    fn name(&self) -> &'static str { ... }
}
Expand description

A backend that knows how to read one or more tabular formats. Implementors register themselves with an Engine.

Send + Sync so engines can be shared across threads. All methods take &self so implementors can wrap their internals in Arc<Mutex<...>> if they need interior state.

Required Methods§

Source

fn extensions(&self) -> &[&'static str]

Lowercase file extensions this reader handles, without the leading dot (e.g. &["xlsx", "xls"]).

Source

fn read(&self, path: &Path, options: &ReadOptions) -> Result<Table>

Open and read the file at path per the supplied options.

Provided Methods§

Source

fn name(&self) -> &'static str

Human-readable backend name for diagnostics ("calamine", "csv").

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Reader for CalamineReader

Available on crate feature calamine only.
Source§

impl Reader for CsvReader

Available on crate feature csv only.