pub enum ConfigFormat {
Json,
Json5,
Toml,
}
Expand description
Enumerates supported configuration formats.
⚠️ Warning: Available variants depend on the enabled feature flags, don’t do exhaustive matching on them in libraries.
Variants§
Json
JSON
Detected via the .json
file extension.
Json5
Detected via the .json5
file extension.
Toml
Detected via the .toml
file extension.
Implementations§
Source§impl ConfigFormat
impl ConfigFormat
Sourcepub fn guess_from_path(path: impl AsRef<Path>) -> Option<Self>
pub fn guess_from_path(path: impl AsRef<Path>) -> Option<Self>
From a given path this guesses the appropriate format based on the file extension
Trait Implementations§
Source§impl Clone for ConfigFormat
impl Clone for ConfigFormat
Source§fn clone(&self) -> ConfigFormat
fn clone(&self) -> ConfigFormat
Returns a duplicate 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 ConfigFormat
impl Debug for ConfigFormat
Source§impl<'de> Deserialize<'de> for ConfigFormat
impl<'de> Deserialize<'de> for ConfigFormat
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ConfigFormat
impl Display for ConfigFormat
Source§impl Hash for ConfigFormat
impl Hash for ConfigFormat
Source§impl PartialEq for ConfigFormat
impl PartialEq for ConfigFormat
Source§impl Serialize for ConfigFormat
impl Serialize for ConfigFormat
impl Copy for ConfigFormat
impl Eq for ConfigFormat
impl StructuralPartialEq for ConfigFormat
Auto Trait Implementations§
impl Freeze for ConfigFormat
impl RefUnwindSafe for ConfigFormat
impl Send for ConfigFormat
impl Sync for ConfigFormat
impl Unpin for ConfigFormat
impl UnwindSafe for ConfigFormat
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