OptionSet

Struct OptionSet 

Source
pub struct OptionSet {
    pub selected: Option<Vec<String>>,
    pub indices: Vec<u32>,
    pub path: Option<String>,
    pub rows: RowOptionSet,
    pub jsonl: bool,
    pub max: Option<u32>,
    pub omit_header: bool,
    pub header_row: u8,
    pub read_mode: ReadMode,
    pub field_mode: FieldNameMode,
}
Expand description

Core options with nested row options

Fields§

§selected: Option<Vec<String>>§indices: Vec<u32>§path: Option<String>§rows: RowOptionSet§jsonl: bool§max: Option<u32>§omit_header: bool§header_row: u8§read_mode: ReadMode§field_mode: FieldNameMode

Implementations§

Source§

impl OptionSet

Source

pub fn new(path_str: &str) -> Self

Instantiates a new option set with a path string for file operations.

Source

pub fn sheet_name(self, name: &str) -> Self

Sets the sheet name for the operation.

Source

pub fn sheet_names(self, names: &[String]) -> Self

Sets the sheet name for the operation.

Source

pub fn sheet_index(self, index: u32) -> Self

Sets the sheet index.

Source

pub fn sheet_indices(self, indices: &[u32]) -> Self

Sets the sheet index.

Source

pub fn json_lines(self) -> Self

Sets JSON Lines mode to true.

Source

pub fn set_json_lines(self, mode: bool) -> Self

Sets JSON Lines mode

Source

pub fn omit_header(self) -> Self

Omits the header when reading.

Source

pub fn header_row(self, row: u8) -> Self

Sets the header row index.

Source

pub fn max_row_count(self, max: u32) -> Self

Sets the maximum number of rows to read.

Source

pub fn read_mode_async(self) -> Self

Sets the read mode to asynchronous, single sheet mode This is for reading long files with 10K+ rows in the target sheet

Source

pub fn read_mode_preview(self) -> Self

Sets the read mode to direct with multiple sheet output This serves to fetch quick a overview of a spreadsheet

Source

pub fn set_read_mode(self, key: &str) -> Self

Sets read mode from a range of common key names async, preview or sync (default) with synonyms such as a, p and s If the key is unmatched, it will always default to Sync

Source

pub fn multimode(&self) -> bool

Source

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

Source

pub fn override_headers(self, keys: &[&str]) -> Self

Override matched and unmatched headers with custom headers.

Source

pub fn override_columns(self, cols: &[Value]) -> Self

Override matched and unmatched columns with custom keys and/or formatting options

Source

pub fn field_name_mode(self, system: &str, override_header: bool) -> Self

Sets the column key naming convention.

Source

pub fn row_mode(&self) -> String

Source

pub fn header_mode(&self) -> String

Source

pub fn to_json(&self) -> Value

render option output contextually as JSON

Source

pub fn index_list(&self) -> String

Source

pub fn to_lines(&self) -> Vec<String>

render option output contextually as a list of strings for use in a terminal or text output

Source

pub fn header_row_index(&self) -> usize

header row index as usize

Source

pub fn max_rows(&self) -> usize

get the maximum of rows to be output synchronously

Source

pub fn columns(&self) -> Vec<Column>

future development with advanced column options

Source

pub fn read_mode(&self) -> ReadMode

cloned read mode

Source

pub fn is_async(&self) -> bool

Needs full data set to processed later

Source

pub fn capture_rows(&self) -> bool

Trait Implementations§

Source§

impl Clone for OptionSet

Source§

fn clone(&self) -> OptionSet

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OptionSet

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for OptionSet

Source§

fn default() -> OptionSet

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.