#[non_exhaustive]pub enum Quotes {
None,
Value,
}Expand description
How quoted values are read.
use std::collections::BTreeMap;
use deser_ini::{DeserializerConfig, Quotes};
let input = "a = \" x ; y \" ; comment\nb = \"say \\\"hi\\\"\"\nc = \"a\" \"b\"";
let values: BTreeMap<String, String> = deser_ini::from_str(input).unwrap();
assert_eq!(values["a"], " x ; y ");
assert_eq!(values["b"], "say \"hi\"");
assert_eq!(values["c"], "\"a\" \"b\"");
let config = DeserializerConfig::builder().quotes(Quotes::None).build();
let values: BTreeMap<String, String> = config.from_str("a = \"x\"").unwrap();
assert_eq!(values["a"], "\"x\"");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
Quotes are text.
Value
A value that is quoted as a whole (with " or ', optionally
followed by a comment) is read without the quotes. In double quotes
\" and \\ are escapes, other backslashes are text. Values with
quotes in other places are text.
Trait Implementations§
impl Copy for Quotes
impl Eq for Quotes
impl StructuralPartialEq for Quotes
Auto Trait Implementations§
impl Freeze for Quotes
impl RefUnwindSafe for Quotes
impl Send for Quotes
impl Sync for Quotes
impl Unpin for Quotes
impl UnsafeUnpin for Quotes
impl UnwindSafe for Quotes
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