pub struct CsvOptions {
pub delimiter: u8,
pub record_terminator: RecordTerminator,
pub quote: u8,
pub escape: Option<u8>,
pub double_quote: bool,
}
Expand description
Cli
configuration options specific to how to parse the CSV file.
CsvOptions
implements Default
with the following defaults:
extern crate csv;
use csv_sanity::cli::CsvOptions;
use csv::RecordTerminator;
let defaults = CsvOptions {
delimiter: b',',
record_terminator: csv::RecordTerminator::CRLF,
quote: b'"',
escape: None,
double_quote: true,
};
assert_eq!(defaults, Default::default());
Fields§
§delimiter: u8
Field delimeter to expect in the CSV file.
Corresponds to the csv::Reader.delimiter
method.
record_terminator: RecordTerminator
Record terminator to expect in the CSV file.
Corresponds to the csv::Reader.record_terminator
method. See csv::RecordTerminator
.
quote: u8
Field quotation character to expect in the CSV file.
Corresponds to the csv::Reader.quote
method.
escape: Option<u8>
Escape character to expect in the CSV file.
Corresponds to the csv::Reader.escape
method.
double_quote: bool
Whether two adjacent quote characters should be interpreted as an escaped quote character.
Corresponds to the csv::Reader.double_quote
method.
Trait Implementations§
Source§impl Default for CsvOptions
impl Default for CsvOptions
Source§fn default() -> CsvOptions
fn default() -> CsvOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CsvOptions
impl RefUnwindSafe for CsvOptions
impl Send for CsvOptions
impl Sync for CsvOptions
impl Unpin for CsvOptions
impl UnwindSafe for CsvOptions
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