pub enum Format {
Json,
Yaml,
}Expand description
The two config-file syntaxes.
Variants§
Implementations§
Source§impl Format
impl Format
pub fn as_str(self) -> &'static str
Sourcepub fn detect(path: Option<&Path>, text: &str) -> Format
pub fn detect(path: Option<&Path>, text: &str) -> Format
Decide the format of a config document: the file extension when it is a
known one (.yaml/.yml ⇒ YAML; .json/.jsonc ⇒ JSON), else by
sniffing the text — a document whose first significant character (after
whitespace and ////* */ comments) is { or [ is JSON, anything
else is YAML.
Trait Implementations§
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
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