#[non_exhaustive]pub enum Continuation {
None,
Indented,
Backslash,
}Expand description
How values continue on the next lines.
use std::collections::BTreeMap;
use deser_ini::{Continuation, DeserializerConfig};
let config = DeserializerConfig::new();
let value: BTreeMap<String, String> =
config.from_str("deps =\n a\n b\nnext = 1").unwrap();
assert_eq!(value["deps"], "a\nb");
let config =
DeserializerConfig::builder().continuation(Continuation::Backslash).build();
let value: BTreeMap<String, String> =
config.from_str("cmd = a \\\n b").unwrap();
assert_eq!(value["cmd"], "a b");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
Values are a single line, indented lines are lines of their own.
Indented
Lines that are indented more than the line of the key continue its
value, like in Python’s configparser.
The lines are joined with line breaks (without the indentation),
empty lines between them are kept. If the line of the key has no
value (key =), the value starts on the next line. Comment lines
are skipped.
Backslash
A backslash at the end of a line continues the value on the next line (the backslash and the line break are removed), like in Windows INF files and systemd units.
Trait Implementations§
Source§impl Clone for Continuation
impl Clone for Continuation
impl Copy for Continuation
Source§impl Debug for Continuation
impl Debug for Continuation
Source§impl Default for Continuation
impl Default for Continuation
impl Eq for Continuation
Source§impl PartialEq for Continuation
impl PartialEq for Continuation
impl StructuralPartialEq for Continuation
Auto Trait Implementations§
impl Freeze for Continuation
impl RefUnwindSafe for Continuation
impl Send for Continuation
impl Sync for Continuation
impl Unpin for Continuation
impl UnsafeUnpin for Continuation
impl UnwindSafe for Continuation
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