pub enum Format {
Json,
Jsonc,
Yaml,
Toml,
Ini,
Env,
Csv,
}Expand description
A config file format.
The variants always exist; whether a format can actually be parsed
depends on the matching Cargo feature. Which extensions a format reads
is part of FormatSpec.
Variants§
Implementations§
Source§impl Format
impl Format
Sourcepub fn from_id(id: &str) -> Option<Format>
pub fn from_id(id: &str) -> Option<Format>
Look a format up by its string id ("json", "jsonc", "yaml",
"toml", "ini", "env", "csv").
Sourcepub fn default_extensions(self) -> &'static [&'static str]
pub fn default_extensions(self) -> &'static [&'static str]
The extensions (without the dot) this format claims by default.
Extension matching is always case-insensitive, and a hidden file
named .X is treated as having extension X (so .env matches the
env extension).
Sourcepub fn exts<I, S>(self, extensions: I) -> FormatSpec
pub fn exts<I, S>(self, extensions: I) -> FormatSpec
Pair this format with custom extensions.
Trait Implementations§
impl Copy for Format
impl Eq for Format
Source§impl From<Format> for FormatSpec
impl From<Format> for FormatSpec
Source§impl From<Format> for FormatKind
impl From<Format> for FormatKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.