[][src]Enum oceanpkg::config::file::ConfigFileFmt

pub enum ConfigFileFmt {
    Toml,
    Json,
    Yaml,
}

The format of the configuration file.

Variants

Toml
Json

JavaScript Object Notation.

Extension: json

Yaml

YAML Ain't Markup Language.

Extensions: yaml, yml

Methods

impl ConfigFileFmt[src]

pub fn from_bytes(bytes: &[u8]) -> Option<Self>[src]

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.

pub fn from_path(path: &Path) -> Option<Self>[src]

Returns the corresponding variant for the file pointed to at path based on its extension, going from TOML to JSON to YAML in order.

Trait Implementations

impl Clone for ConfigFileFmt[src]

impl Copy for ConfigFileFmt[src]

impl Debug for ConfigFileFmt[src]

impl Eq for ConfigFileFmt[src]

impl Hash for ConfigFileFmt[src]

impl Ord for ConfigFileFmt[src]

impl PartialEq<ConfigFileFmt> for ConfigFileFmt[src]

impl PartialOrd<ConfigFileFmt> for ConfigFileFmt[src]

impl StructuralEq for ConfigFileFmt[src]

impl StructuralPartialEq for ConfigFileFmt[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.