Struct csv_sniffer::metadata::Dialect
[−]
[src]
pub struct Dialect { pub delimiter: u8, pub header: Header, pub terminator: Terminator, pub quote: Quote, pub doublequote_escapes: bool, pub escape: Escape, pub comment: Comment, pub flexible: bool, }
Dialect-level metadata. This type encapsulates the details to be used to derive a
ReaderBuilder
object (in the csv
crate).
Not all components of this type are currently detected by the sniffer, and may be detected in the future.
Fields
delimiter: u8
CSV delimiter (field separator). Detected by sniffer.
header: Header
Header
subtype (header row boolean and number of preamble rows).
Detected by sniffer.
terminator: Terminator
Record terminator. Currently not detected by sniffer; defaults to Terminator::CRLF
.
quote: Quote
Record quoting details. Detected by sniffer.
doublequote_escapes: bool
Whether or not doubled quotes are interpreted as escapes. Currently not detected by sniffer;
defaults to true
.
escape: Escape
Character used as escape, if any. Currently not detected by sniffer; defaults to
Escape::Disabled
(to escape a quote, use double quotes).
comment: Comment
Character used as comment, if any. Currently not detected by sniffer; defaults to
Comment::Disabled
.
flexible: bool
Whether or not the number of fields in a record is allowed to change. Detected by sniffer.
Methods
impl Dialect
[src]
pub fn open_path<P: AsRef<Path>>(&self, path: P) -> Result<Reader<File>>
[src]
Use this Dialect
to open a file specified by provided path. Returns a Reader
(from the
csv
crate). Fails on file opening or reading errors.
pub fn open_reader<R: Read + Seek>(&self, rdr: R) -> Result<Reader<R>>
[src]
Use this Dialect
to create a Reader
(from the csv
crate) using
the provided reader. Fails if unable to read from the reader.
Trait Implementations
impl Clone for Dialect
[src]
fn clone(&self) -> Dialect
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Dialect
[src]
fn eq(&self, other: &Dialect) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Debug for Dialect
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Dialect
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl From<Dialect> for ReaderBuilder
[src]
fn from(dialect: Dialect) -> ReaderBuilder
[src]
Performs the conversion.