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: 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: String) -> Self
pub fn sheet_name(self, name: 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 json_lines(self) -> Self
pub fn json_lines(self) -> Self
Sets JSON Lines mode to true.
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.
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 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 to_json(&self) -> Value
pub fn to_lines(&self) -> Vec<String>
Sourcepub fn header_row_index(&self) -> usize
pub fn header_row_index(&self) -> usize
header row index as usize
pub fn capture_rows(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OptionSet
impl RefUnwindSafe for OptionSet
impl Send for OptionSet
impl Sync for OptionSet
impl Unpin for OptionSet
impl UnwindSafe for OptionSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more