spreadsheet_to_json::options

Struct OptionSet

Source
pub struct OptionSet {
    pub sheet: Option<String>,
    pub index: 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§

§sheet: Option<String>§index: 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(&mut self, name: String) -> &mut Self

Sets the sheet name for the operation.

Source

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

Sets the sheet index.

Source

pub fn json_lines(&mut self) -> &mut Self

Sets JSON Lines mode to true.

Source

pub fn omit_header(&mut self) -> &mut Self

Omits the header when reading.

Source

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

Sets the header row index

Source

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

Sets the maximum number of rows to read.

Source

pub fn read_mode_async(&mut self) -> &mut Self

Sets the read mode to asynchronous.

Source

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

Sets the column key naming convetion

Source

pub fn row_mode(&self) -> String

Source

pub fn header_mode(&self) -> String

Source

pub fn to_json(&self) -> Value

Source

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

Source

pub fn header_row_index(&self) -> usize

header row index as usize

Source

pub fn max_rows(&self) -> usize

set 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 copy 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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.