Trait JsonConfig

Source
pub trait JsonConfig<T = HashMap<String, String>>: AbstractConfig<T> {
    // Provided method
    fn load(target: Option<String>) -> Result<T, Error>
       where T: Default,
             HashMap<String, String>: Into<T>,
             Self: Sized { ... }
}
Expand description

Indicates that structure can be initialized from JSON file.

Provided Methods§

Source

fn load(target: Option<String>) -> Result<T, Error>
where T: Default, HashMap<String, String>: Into<T>, Self: Sized,

Load specified JSON file and initialize the structure.

§Arguments
  • target - Path to the JSON file.
§Errors
  • Error::LoadFileError - If the specified JSON file cannot be loaded or parsed.

Implementors§