pub struct SerializerConfigBuilder { /* private fields */ }Expand description
Builds a SerializerConfig.
The methods have the names of the setters of SerializerConfig (without set_).
Implementations§
Source§impl SerializerConfigBuilder
impl SerializerConfigBuilder
Sourcepub const fn new() -> SerializerConfigBuilder
pub const fn new() -> SerializerConfigBuilder
Creates a builder that starts with the default.
Sourcepub const fn delimiter(self, delimiter: u8) -> SerializerConfigBuilder
pub const fn delimiter(self, delimiter: u8) -> SerializerConfigBuilder
Sets the character that separates fields (, by default).
Sourcepub const fn quote(self, quote: Option<u8>) -> SerializerConfigBuilder
pub const fn quote(self, quote: Option<u8>) -> SerializerConfigBuilder
Sets the character that quotes fields (" by default).
Sourcepub const fn double_quote(self, yes: bool) -> SerializerConfigBuilder
pub const fn double_quote(self, yes: bool) -> SerializerConfigBuilder
Sets if quotes in quoted fields are doubled (true by default).
Sourcepub const fn escape(self, escape: Escape) -> SerializerConfigBuilder
pub const fn escape(self, escape: Escape) -> SerializerConfigBuilder
Sets how characters are escaped (not at all by default).
Sourcepub const fn terminator(self, terminator: Terminator) -> SerializerConfigBuilder
pub const fn terminator(self, terminator: Terminator) -> SerializerConfigBuilder
Sets the line ending (\n by default, see Terminator).
Sourcepub const fn quote_style(self, style: QuoteStyle) -> SerializerConfigBuilder
pub const fn quote_style(self, style: QuoteStyle) -> SerializerConfigBuilder
Sets when fields are quoted (QuoteStyle::Necessary by default).
Sourcepub const fn headers(self, yes: bool) -> SerializerConfigBuilder
pub const fn headers(self, yes: bool) -> SerializerConfigBuilder
Sets if the names of the columns are written before the first
Sourcepub const fn columns(
self,
names: &'static [&'static str],
) -> SerializerConfigBuilder
pub const fn columns( self, names: &'static [&'static str], ) -> SerializerConfigBuilder
Sets the names of the columns (by default they are the keys of the
Sourcepub const fn nulls(self, nulls: Nulls) -> SerializerConfigBuilder
pub const fn nulls(self, nulls: Nulls) -> SerializerConfigBuilder
Sets how null is written (Nulls::None by default).
Sourcepub const fn flexible(self, yes: bool) -> SerializerConfigBuilder
pub const fn flexible(self, yes: bool) -> SerializerConfigBuilder
Sets if records can have a different number of fields (false by
Sourcepub const fn escape_formulas(self, yes: bool) -> SerializerConfigBuilder
pub const fn escape_formulas(self, yes: bool) -> SerializerConfigBuilder
Sets if strings that spreadsheets would run as formulas are escaped
Sourcepub fn context(self, context: Context) -> SerializerConfigBuilder
pub fn context(self, context: Context) -> SerializerConfigBuilder
Sets the context the values are serialized in.
Sourcepub const fn build(self) -> SerializerConfig
pub const fn build(self) -> SerializerConfig
Returns the built SerializerConfig.