pub struct Format { /* private fields */ }
Expand description
The format specification for the CSV file
Implementations§
source§impl Format
impl Format
pub fn with_header(self, has_header: bool) -> Format
pub fn with_delimiter(self, delimiter: u8) -> Format
pub fn with_escape(self, escape: u8) -> Format
pub fn with_quote(self, quote: u8) -> Format
pub fn with_terminator(self, terminator: u8) -> Format
pub fn with_comment(self, comment: u8) -> Format
sourcepub fn with_null_regex(self, null_regex: Regex) -> Format
pub fn with_null_regex(self, null_regex: Regex) -> Format
Provide a regex to match null values, defaults to ^$
sourcepub fn with_truncated_rows(self, allow: bool) -> Format
pub fn with_truncated_rows(self, allow: bool) -> Format
Whether to allow truncated rows when parsing.
By default this is set to false
and will error if the CSV rows have different lengths.
When set to true then it will allow records with less than the expected number of columns
and fill the missing columns with nulls. If the record’s schema is not nullable, then it
will still return an error.
sourcepub fn infer_schema<R>(
&self,
reader: R,
max_records: Option<usize>,
) -> Result<(Schema, usize), ArrowError>where
R: Read,
pub fn infer_schema<R>(
&self,
reader: R,
max_records: Option<usize>,
) -> Result<(Schema, usize), ArrowError>where
R: Read,
Infer schema of CSV records from the provided reader
If max_records
is None
, all records will be read, otherwise up to max_records
records are read to infer the schema
Returns inferred schema and number of records read
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnwindSafe for Format
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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