#[non_exhaustive]pub enum Escape {
None,
Char(u8),
Backslash,
}Expand description
How characters are escaped.
use deser_csv::{DeserializerConfig, Escape, Headers};
let config = DeserializerConfig::builder()
.headers(Headers::None)
.escape(Escape::Backslash)
.double_quote(false).build();
let rows: Vec<Vec<String>> = config.from_str(r#""a\"b",c\,d"#).unwrap();
assert_eq!(rows, [["a\"b", "c,d"]]);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
Nothing is escaped (quotes in quoted fields are doubled).
Char(u8)
The character after this one is taken as it is (in quoted and
unquoted fields), like escapechar of Python’s csv module.
Backslash
Backslash escapes: \t, \n, \r and \0 are a tab, line feed,
carriage return and NUL, a backslash followed by another character
is that character (\\, \", \,). This is how databases (like
PostgreSQL and MySQL) write delimited text.
Trait Implementations§
impl Copy for Escape
impl Eq for Escape
impl StructuralPartialEq for Escape
Auto Trait Implementations§
impl Freeze for Escape
impl RefUnwindSafe for Escape
impl Send for Escape
impl Sync for Escape
impl Unpin for Escape
impl UnsafeUnpin for Escape
impl UnwindSafe for Escape
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