pub struct CsvOptions {
pub delimiter: String,
pub has_headers: bool,
pub quote: String,
pub flexible: Option<bool>,
pub null_values: Vec<String>,
pub on_unknown_field: CsvUnknownField,
}Expand description
CSV dialect.
Fields§
§delimiter: StringField separator. A single character; "\t" is accepted for tabs.
has_headers: boolWhether the first row names the fields. When false, fields are named
column_0, column_1, … — the same fallback the REST source and the
csv connector already use. On write it decides whether a header row
is written; write_headers is accepted as another name for it.
quote: StringQuote character. A single byte; default ".
flexible: Option<bool>Whether rows may have a different number of fields than the header.
false fails the read on the first ragged row, naming its line; true
keeps the fields the row has. Unset, each connector picks: the file
source is strict, the object-store sources and the REST source are
lenient.
null_values: Vec<String>Cell values read as null instead of a string (e.g. ["", "NULL"]).
on_unknown_field: CsvUnknownFieldWhat a streaming CSV writer does with a field the header does not
have. See CsvUnknownField. Whole-object encoders always write the
union of every record’s fields, so it only affects the file sink.
Implementations§
Source§impl CsvOptions
impl CsvOptions
Sourcepub fn delimiter_byte(&self) -> Result<u8, FaucetError>
pub fn delimiter_byte(&self) -> Result<u8, FaucetError>
The delimiter as the single byte the CSV readers want.
Rejected rather than truncated: a multi-byte delimiter silently becoming its first byte would split every row in the wrong place and produce plausible-looking garbage.
Sourcepub fn quote_byte(&self) -> Result<u8, FaucetError>
pub fn quote_byte(&self) -> Result<u8, FaucetError>
The quote character as a single byte.
Sourcepub fn flexible_or(&self, default: bool) -> bool
pub fn flexible_or(&self, default: bool) -> bool
Whether ragged rows are accepted, with default when unset.
Sourcepub fn validate(&self) -> Result<(), FaucetError>
pub fn validate(&self) -> Result<(), FaucetError>
Check the single-byte fields, so a bad dialect fails at load time.
Trait Implementations§
Source§impl Clone for CsvOptions
impl Clone for CsvOptions
Source§impl Debug for CsvOptions
impl Debug for CsvOptions
Source§impl Default for CsvOptions
impl Default for CsvOptions
Source§impl<'de> Deserialize<'de> for CsvOptions
impl<'de> Deserialize<'de> for CsvOptions
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>,
impl Eq for CsvOptions
Source§impl JsonSchema for CsvOptions
impl JsonSchema for CsvOptions
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for CsvOptions
impl PartialEq for CsvOptions
Source§impl Serialize for CsvOptions
impl Serialize for CsvOptions
impl StructuralPartialEq for CsvOptions
Auto Trait Implementations§
impl Freeze for CsvOptions
impl RefUnwindSafe for CsvOptions
impl Send for CsvOptions
impl Sync for CsvOptions
impl Unpin for CsvOptions
impl UnsafeUnpin for CsvOptions
impl UnwindSafe for CsvOptions
Blanket Implementations§
impl<T> Allocation for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request