Struct dts_core::de::DeserializerBuilder
source · [−]pub struct DeserializerBuilder { /* private fields */ }Expand description
A DeserializerBuilder can be used to build a Deserializer with certain
DeserializeOptions.
Example
use dts_core::{de::DeserializerBuilder, Encoding};
let buf = r#"["foo"]"#.as_bytes();
let deserializer = DeserializerBuilder::new()
.csv_delimiter(b'\t')
.build(buf);Implementations
sourceimpl DeserializerBuilder
impl DeserializerBuilder
sourcepub fn csv_without_headers(&mut self, yes: bool) -> &mut Self
pub fn csv_without_headers(&mut self, yes: bool) -> &mut Self
Indicates that an input CSV does not include a header line. If false, the first line is
discarded.
sourcepub fn csv_headers_as_keys(&mut self, yes: bool) -> &mut Self
pub fn csv_headers_as_keys(&mut self, yes: bool) -> &mut Self
Indicates that the header fields of an input CSV should be used as keys for each row’s columns. This means that the deserialized row data will be of type object. Otherwise row data will be of type array.
sourcepub fn csv_delimiter(&mut self, delim: u8) -> &mut Self
pub fn csv_delimiter(&mut self, delim: u8) -> &mut Self
Sets a custom CSV delimiter.
sourcepub fn text_split_pattern(&mut self, pattern: Regex) -> &mut Self
pub fn text_split_pattern(&mut self, pattern: Regex) -> &mut Self
Sets regex pattern to split text at.
sourcepub fn build<R>(&self, reader: R) -> Deserializer<R> where
R: Read,
pub fn build<R>(&self, reader: R) -> Deserializer<R> where
R: Read,
Builds the Deserializer for the given reader.
Trait Implementations
sourceimpl Clone for DeserializerBuilder
impl Clone for DeserializerBuilder
sourcefn clone(&self) -> DeserializerBuilder
fn clone(&self) -> DeserializerBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for DeserializerBuilder
impl Debug for DeserializerBuilder
sourceimpl Default for DeserializerBuilder
impl Default for DeserializerBuilder
sourcefn default() -> DeserializerBuilder
fn default() -> DeserializerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for DeserializerBuilder
impl Send for DeserializerBuilder
impl Sync for DeserializerBuilder
impl Unpin for DeserializerBuilder
impl UnwindSafe for DeserializerBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more