#[non_exhaustive]pub enum Nulls {
None,
Empty,
Text(&'static str),
}Expand description
Which fields are null.
Only unquoted fields are null, which allows writing the empty string (or the text of null) in quotes.
use deser_csv::{DeserializerConfig, Headers, Nulls};
let mut config = DeserializerConfig::builder().headers(Headers::None).build();
let rows: Vec<Vec<Option<String>>> = config.from_str(",\"\"\n").unwrap();
assert_eq!(rows, [[Some("".to_string()), Some("".to_string())]]);
config.set_nulls(Nulls::Empty);
let rows: Vec<Vec<Option<String>>> = config.from_str(",\"\"\n").unwrap();
assert_eq!(rows, [[None, Some("".to_string())]]);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
No field is null. Empty fields are still None for optionals of
types that do not accept the empty string.
Empty
Empty fields are null (like PostgreSQL’s CSV format).
Text(&'static str)
Fields with this text are null (like \N or NULL).
Trait Implementations§
impl Copy for Nulls
impl Eq for Nulls
impl StructuralPartialEq for Nulls
Auto Trait Implementations§
impl Freeze for Nulls
impl RefUnwindSafe for Nulls
impl Send for Nulls
impl Sync for Nulls
impl Unpin for Nulls
impl UnsafeUnpin for Nulls
impl UnwindSafe for Nulls
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