Skip to main content

Engine

Struct Engine 

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

Dispatches read calls to the registered Reader for the file’s extension. Construct with Engine::new for an empty engine, or Engine::with_defaults for the readers matching enabled feature flags.

Implementations§

Source§

impl Engine

Source

pub fn new() -> Self

New engine with no readers registered.

Source

pub fn with_defaults() -> Self

New engine with the default readers for enabled feature flags. With both calamine and csv features on (the default), this engine handles XLSX/XLS/XLSB/XLSM/ODS plus CSV/TSV out of the box.

Source

pub fn register(&mut self, reader: Box<dyn Reader>) -> &mut Self

Register a backend. Multiple backends can claim the same extension; the first registered wins on dispatch (so you can override defaults by registering your own reader first).

Source

pub fn len(&self) -> usize

Returns the number of registered readers.

Source

pub fn is_empty(&self) -> bool

Returns true when no readers are registered.

Source

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

Read path as a Table, dispatching by file extension.

Trait Implementations§

Source§

impl Default for Engine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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.