pub struct EncoderBuilder<W>where
W: Write,{ /* private fields */ }Expand description
Helper for constructing a CSV Encoder.
No fields are required.
Implementations§
Source§impl<W> EncoderBuilder<W>where
W: Write,
impl<W> EncoderBuilder<W>where
W: Write,
Sourcepub fn use_pretty_px(self, use_pretty_px: bool) -> Self
pub fn use_pretty_px(self, use_pretty_px: bool) -> Self
Sets whether the CSV encoder will serialize price fields as a decimal. Defaults
to false.
Sourcepub fn use_pretty_ts(self, use_pretty_ts: bool) -> Self
pub fn use_pretty_ts(self, use_pretty_ts: bool) -> Self
Sets whether the CSV encoder will serialize timestamp fields as ISO8601 datetime
strings. Defaults to false.
Sourcepub fn write_header(self, write_header: bool) -> Self
pub fn write_header(self, write_header: bool) -> Self
Sets whether the CSV encoder will write a header row automatically.
Defaults to true.
If false, a header row can still be written with
Encoder::encode_header() or Encoder::encode_header_for_schema().
Sourcepub fn schema(self, schema: Option<Schema>) -> Self
pub fn schema(self, schema: Option<Schema>) -> Self
Sets the schema that will be encoded, used for determining the header row to write.
If schema isn’t set and write_header is left enabled, the header will be written
based on the type of the first record.
Sourcepub fn ts_out(self, ts_out: bool) -> Self
pub fn ts_out(self, ts_out: bool) -> Self
Sets whether to add a header field “ts_out”. Defaults to false.
Sourcepub fn with_symbol(self, with_symbol: bool) -> Self
pub fn with_symbol(self, with_symbol: bool) -> Self
Sets whether to add a header field “symbol”. Defaults to false.