pub struct Sniffer { /* private fields */ }
Expand description

A CSV sniffer.

The sniffer examines a CSV file, passed in either through a file or a reader.

Implementations

Create a new CSV sniffer.

Specify the delimiter character.

Specify the header type (whether the CSV file has a header row, and where the data starts).

Specify the quote character (if any), and whether two quotes in a row as to be interepreted as an escaped quote.

The size of the sample to examine while sniffing. If using SampleSize::Records, the sniffer will use the Terminator::CRLF as record separator.

The sample size defaults to SampleSize::Bytes(4096).

Sniff the CSV file located at the provided path, and return a Reader (from the csv crate) ready to ready the file.

Fails on file opening or readering errors, or on an error examining the file.

Sniff the CSV file provided by the reader, and return a csv Reader object.

Fails on file opening or readering errors, or on an error examining the file.

Sniff the CSV file located at the provided path, and return a Metadata object containing information about the CSV file.

Fails on file opening or readering errors, or on an error examining the file.

Sniff the CSV file provider by the reader, and return a Metadata object containing information about the CSV file.

Fails on file opening or readering errors, or on an error examining the file.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.