LoadSheetOrTableOptions

Struct LoadSheetOrTableOptions 

Source
pub struct LoadSheetOrTableOptions {
    pub header_row: Option<usize>,
    pub column_names: Option<Vec<String>>,
    pub skip_rows: SkipRows,
    pub n_rows: Option<usize>,
    pub schema_sample_rows: Option<usize>,
    pub dtype_coercion: DTypeCoercion,
    pub selected_columns: SelectedColumns,
    pub dtypes: Option<DTypes>,
}
Expand description

Options for loading a sheet or table.

Fields§

§header_row: Option<usize>

The index of the row containing the column labels. If None, the provided headers are used. Any row before the header row is skipped.

§column_names: Option<Vec<String>>

The column names to use. If None, the column names are inferred from the header row.

§skip_rows: SkipRows

How rows should be skipped.

§n_rows: Option<usize>

The number of rows to read. If None, all rows are read.

§schema_sample_rows: Option<usize>

The number of rows to sample for schema inference. If None, all rows are sampled.

§dtype_coercion: DTypeCoercion

How data types should be coerced.

§selected_columns: SelectedColumns

The columns to select.

§dtypes: Option<DTypes>

Override the inferred data types.

Implementations§

Source§

impl LoadSheetOrTableOptions

Source

pub fn new_for_sheet() -> Self

Returns a new LoadSheetOrTableOptions instance for loading a sheet. header_row is set to Some(0)

Source

pub fn new_for_table() -> Self

Returns a new LoadSheetOrTableOptions instance for loading a sheet. header_row is set to None

Source

pub fn header_row(self, header_row: usize) -> Self

Source

pub fn no_header_row(self) -> Self

Source

pub fn column_names<I: IntoIterator<Item = impl Into<String>>>( self, column_names: I, ) -> Self

Source

pub fn skip_rows(self, skip_rows: SkipRows) -> Self

Source

pub fn n_rows(self, n_rows: usize) -> Self

Source

pub fn schema_sample_rows(self, schema_sample_rows: usize) -> Self

Source

pub fn dtype_coercion(self, dtype_coercion: DTypeCoercion) -> Self

Source

pub fn selected_columns(self, selected_columns: SelectedColumns) -> Self

Source

pub fn with_dtypes(self, dtypes: DTypes) -> Self

Trait Implementations§

Source§

impl Debug for LoadSheetOrTableOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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.