BaseConfig

Trait BaseConfig 

Source
pub trait BaseConfig:
    Sized
    + Default
    + Serialize
    + for<'a> Deserialize<'a> {
    const PACKAGE: &'static str;

    // Provided methods
    fn path() -> Option<PathBuf> { ... }
    fn load() -> Result<Self> { ... }
    fn load_path<P>(path: P) -> Result<Self>
       where P: AsRef<Path> { ... }
}
Expand description

Base configuration schema

Required Associated Constants§

Source

const PACKAGE: &'static str

Package name (e.g. CARGO_PKG_NAME)

Provided Methods§

Source

fn path() -> Option<PathBuf>

Path of the serialized configuration

Source

fn load() -> Result<Self>

Load a config instance from the config dir

Source

fn load_path<P>(path: P) -> Result<Self>
where P: AsRef<Path>,

Load a config file from a given path

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl BaseConfig for Config

Source§

const PACKAGE: &'static str = "dusk-cdf"