#[non_exhaustive]pub enum Syntax {
Ini,
Git,
}Expand description
The syntax of the files.
use std::collections::BTreeMap;
use deser_ini::{DeserializerConfig, Syntax};
type Config = BTreeMap<String, BTreeMap<String, String>>;
let git = DeserializerConfig::builder().syntax(Syntax::Git).build();
let config: Config = git
.from_str("[Alias]\n\tLG = \"log --graph\" # short\n")
.unwrap();
assert_eq!(config["alias"]["lg"], "log --graph");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.
Ini
INI files, see the crate documentation and the
options of DeserializerConfig.
Git
git’s config files (.gitconfig, .git/config, .gitmodules), read
like git reads them (see git help config).
The names of sections and keys are case insensitive and lowercased,
keys are letters, digits and -. [section "subsection"] (and the
deprecated [section.subsection]) are nested maps. ; and # start
comments anywhere outside of quotes, values can be quoted in parts
(a" b "c), \n, \t, \b, \" and \\ are escapes and a
backslash at the end of a line continues the value on the next
line. Whitespace at the start and the end of values is removed
unless it’s quoted. Includes ([include]) are not followed.
Trait Implementations§
impl Copy for Syntax
impl Eq for Syntax
impl StructuralPartialEq for Syntax
Auto Trait Implementations§
impl Freeze for Syntax
impl RefUnwindSafe for Syntax
impl Send for Syntax
impl Sync for Syntax
impl Unpin for Syntax
impl UnsafeUnpin for Syntax
impl UnwindSafe for Syntax
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