pub struct CsvParseOptions {
pub separator: u8,
pub quote_char: Option<u8>,
pub eol_char: u8,
pub encoding: CsvEncoding,
pub null_values: Option<NullValues>,
pub missing_is_null: bool,
pub truncate_ragged_lines: bool,
pub comment_prefix: Option<CommentPrefix>,
pub try_parse_dates: bool,
pub decimal_comma: bool,
}
csv
or json
only.Fields§
§separator: u8
§quote_char: Option<u8>
§eol_char: u8
§encoding: CsvEncoding
§null_values: Option<NullValues>
§missing_is_null: bool
§truncate_ragged_lines: bool
§comment_prefix: Option<CommentPrefix>
§try_parse_dates: bool
§decimal_comma: bool
Implementations§
Source§impl CsvParseOptions
impl CsvParseOptions
Sourcepub fn with_separator(self, separator: u8) -> Self
pub fn with_separator(self, separator: u8) -> Self
The character used to separate fields in the CSV file. This is most often a comma ‘,’.
Sourcepub fn with_quote_char(self, quote_char: Option<u8>) -> Self
pub fn with_quote_char(self, quote_char: Option<u8>) -> Self
Set the character used for field quoting. This is most often double quotes ‘“’. Set this to None to disable quote parsing.
Sourcepub fn with_eol_char(self, eol_char: u8) -> Self
pub fn with_eol_char(self, eol_char: u8) -> Self
Set the character used to indicate an end-of-line (eol).
Sourcepub fn with_encoding(self, encoding: CsvEncoding) -> Self
pub fn with_encoding(self, encoding: CsvEncoding) -> Self
Set the encoding used by the file.
Sourcepub fn with_null_values(self, null_values: Option<NullValues>) -> Self
pub fn with_null_values(self, null_values: Option<NullValues>) -> Self
Set values that will be interpreted as missing/null.
Note: These values are matched before quote-parsing, so if the null values are quoted then those quotes also need to be included here.
Sourcepub fn with_missing_is_null(self, missing_is_null: bool) -> Self
pub fn with_missing_is_null(self, missing_is_null: bool) -> Self
Treat missing fields as null.
Sourcepub fn with_truncate_ragged_lines(self, truncate_ragged_lines: bool) -> Self
pub fn with_truncate_ragged_lines(self, truncate_ragged_lines: bool) -> Self
Truncate lines that are longer than the schema.
Sourcepub fn with_comment_prefix<T: Into<CommentPrefix>>(
self,
comment_prefix: Option<T>,
) -> Self
pub fn with_comment_prefix<T: Into<CommentPrefix>>( self, comment_prefix: Option<T>, ) -> Self
Sets the comment prefix for this instance. Lines starting with this prefix will be ignored.
Sourcepub fn with_try_parse_dates(self, try_parse_dates: bool) -> Self
pub fn with_try_parse_dates(self, try_parse_dates: bool) -> Self
Automatically try to parse dates/datetimes and time. If parsing fails,
columns remain of dtype [DataType::String]
.
Sourcepub fn with_decimal_comma(self, decimal_comma: bool) -> Self
pub fn with_decimal_comma(self, decimal_comma: bool) -> Self
Parse floats with a comma as decimal separator.
Trait Implementations§
Source§impl Clone for CsvParseOptions
impl Clone for CsvParseOptions
Source§fn clone(&self) -> CsvParseOptions
fn clone(&self) -> CsvParseOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CsvParseOptions
impl Debug for CsvParseOptions
Source§impl Default for CsvParseOptions
impl Default for CsvParseOptions
Options related to parsing the CSV format.
Source§impl<'de> Deserialize<'de> for CsvParseOptions
impl<'de> Deserialize<'de> for CsvParseOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for CsvParseOptions
impl Hash for CsvParseOptions
Source§impl PartialEq for CsvParseOptions
impl PartialEq for CsvParseOptions
Source§impl Serialize for CsvParseOptions
impl Serialize for CsvParseOptions
impl Eq for CsvParseOptions
impl StructuralPartialEq for CsvParseOptions
Auto Trait Implementations§
impl Freeze for CsvParseOptions
impl RefUnwindSafe for CsvParseOptions
impl Send for CsvParseOptions
impl Sync for CsvParseOptions
impl Unpin for CsvParseOptions
impl UnwindSafe for CsvParseOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more