pub struct ReadCsvOptionsBuilder { /* private fields */ }Expand description
ReadCsvOptions 的构建器
提供了一种链式调用的方式来配置 CSV 读取选项。
§示例
let options = ReadCsvOptions::builder()
.with_delimiter(b';')
.with_header(true)
.skip_rows(2)
.build();Implementations§
Source§impl ReadCsvOptionsBuilder
impl ReadCsvOptionsBuilder
Sourcepub fn with_delimiter(self, delimiter: u8) -> Self
pub fn with_delimiter(self, delimiter: u8) -> Self
设置字段分隔符
Sourcepub fn with_header(self, has_header: bool) -> Self
pub fn with_header(self, has_header: bool) -> Self
设置是否包含表头行
Sourcepub fn infer_schema(self, infer: bool) -> Self
pub fn infer_schema(self, infer: bool) -> Self
设置是否启用类型推断
Sourcepub fn infer_schema_length(self, length: Option<usize>) -> Self
pub fn infer_schema_length(self, length: Option<usize>) -> Self
设置类型推断使用的行数
Sourcepub fn with_dtypes(self, dtypes: HashMap<String, DataType>) -> Self
pub fn with_dtypes(self, dtypes: HashMap<String, DataType>) -> Self
设置列数据类型映射
Sourcepub fn comment_char(self, char_opt: Option<u8>) -> Self
pub fn comment_char(self, char_opt: Option<u8>) -> Self
设置注释字符
Sourcepub fn use_columns(self, columns: Vec<String>) -> Self
pub fn use_columns(self, columns: Vec<String>) -> Self
设置要读取的列
Sourcepub fn add_use_column(self, column_name: String) -> Self
pub fn add_use_column(self, column_name: String) -> Self
添加要读取的列
Sourcepub fn add_na_value(self, value: String) -> Self
pub fn add_na_value(self, value: String) -> Self
添加 null 值表示
Sourcepub fn build(self) -> ReadCsvOptions
pub fn build(self) -> ReadCsvOptions
构建最终的 ReadCsvOptions 实例
Trait Implementations§
Source§impl Clone for ReadCsvOptionsBuilder
impl Clone for ReadCsvOptionsBuilder
Source§fn clone(&self) -> ReadCsvOptionsBuilder
fn clone(&self) -> ReadCsvOptionsBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReadCsvOptionsBuilder
impl Debug for ReadCsvOptionsBuilder
Source§impl Default for ReadCsvOptionsBuilder
impl Default for ReadCsvOptionsBuilder
Source§fn default() -> ReadCsvOptionsBuilder
fn default() -> ReadCsvOptionsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ReadCsvOptionsBuilder
impl RefUnwindSafe for ReadCsvOptionsBuilder
impl Send for ReadCsvOptionsBuilder
impl Sync for ReadCsvOptionsBuilder
impl Unpin for ReadCsvOptionsBuilder
impl UnwindSafe for ReadCsvOptionsBuilder
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§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