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: FieldNameModeImplementations§
Source§impl OptionSet
impl OptionSet
Sourcepub fn new(path_str: &str) -> Self
pub fn new(path_str: &str) -> Self
Instantiates a new option set with a path string for file operations.
Sourcepub fn sheet_name(self, name: &str) -> Self
pub fn sheet_name(self, name: &str) -> Self
Sets the sheet name for the operation.
Sourcepub fn sheet_names(self, names: &[String]) -> Self
pub fn sheet_names(self, names: &[String]) -> Self
Sets the sheet name for the operation.
Sourcepub fn sheet_index(self, index: u32) -> Self
pub fn sheet_index(self, index: u32) -> Self
Sets the sheet index.
Sourcepub fn sheet_indices(self, indices: &[u32]) -> Self
pub fn sheet_indices(self, indices: &[u32]) -> Self
Sets the sheet index.
Sourcepub fn json_lines(self) -> Self
pub fn json_lines(self) -> Self
Sets JSON Lines mode to true.
Sourcepub fn set_json_lines(self, mode: bool) -> Self
pub fn set_json_lines(self, mode: bool) -> Self
Sets JSON Lines mode
Sourcepub fn omit_header(self) -> Self
pub fn omit_header(self) -> Self
Omits the header when reading.
Sourcepub fn header_row(self, row: u8) -> Self
pub fn header_row(self, row: u8) -> Self
Sets the header row index.
Sourcepub fn max_row_count(self, max: u32) -> Self
pub fn max_row_count(self, max: u32) -> Self
Sets the maximum number of rows to read.
Sourcepub fn read_mode_async(self) -> Self
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
Sourcepub fn read_mode_preview(self) -> Self
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
Sourcepub fn set_read_mode(self, key: &str) -> Self
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
pub fn multimode(&self) -> bool
pub fn file_name(&self) -> Option<String>
Sourcepub fn override_headers(self, keys: &[&str]) -> Self
pub fn override_headers(self, keys: &[&str]) -> Self
Override matched and unmatched headers with custom headers.
Sourcepub fn override_columns(self, cols: &[Value]) -> Self
pub fn override_columns(self, cols: &[Value]) -> Self
Override matched and unmatched columns with custom keys and/or formatting options
Sourcepub fn field_name_mode(self, system: &str, override_header: bool) -> Self
pub fn field_name_mode(self, system: &str, override_header: bool) -> Self
Sets the column key naming convention.
pub fn row_mode(&self) -> String
pub fn header_mode(&self) -> String
pub fn index_list(&self) -> String
Sourcepub fn to_lines(&self) -> Vec<String>
pub fn to_lines(&self) -> Vec<String>
render option output contextually as a list of strings for use in a terminal or text output
Sourcepub fn header_row_index(&self) -> usize
pub fn header_row_index(&self) -> usize
header row index as usize