pub enum ConfigFileFmt {
Toml,
Json,
Yaml,
}
Expand description
The format of the configuration file.
Variants§
Toml
Tom’s Obvious, Minimal Language.
Extension: toml
Json
Extension: json
Yaml
Extensions: yaml
, yml
Implementations§
Source§impl ConfigFileFmt
impl ConfigFileFmt
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
Returns the corresponding variant for the file extension, going from TOML to JSON to YAML in order.
This expects bytes
to be ASCII/UTF-8 and will simply fail with other
encodings.
Trait Implementations§
Source§impl Clone for ConfigFileFmt
impl Clone for ConfigFileFmt
Source§fn clone(&self) -> ConfigFileFmt
fn clone(&self) -> ConfigFileFmt
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConfigFileFmt
impl Debug for ConfigFileFmt
Source§impl Hash for ConfigFileFmt
impl Hash for ConfigFileFmt
Source§impl Ord for ConfigFileFmt
impl Ord for ConfigFileFmt
Source§fn cmp(&self, other: &ConfigFileFmt) -> Ordering
fn cmp(&self, other: &ConfigFileFmt) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ConfigFileFmt
impl PartialEq for ConfigFileFmt
Source§impl PartialOrd for ConfigFileFmt
impl PartialOrd for ConfigFileFmt
impl Copy for ConfigFileFmt
impl Eq for ConfigFileFmt
impl StructuralPartialEq for ConfigFileFmt
Auto Trait Implementations§
impl Freeze for ConfigFileFmt
impl RefUnwindSafe for ConfigFileFmt
impl Send for ConfigFileFmt
impl Sync for ConfigFileFmt
impl Unpin for ConfigFileFmt
impl UnwindSafe for ConfigFileFmt
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