memea::config

Function read

Source
fn read(filename: &PathBuf) -> Result<Config, MemeaError>
Expand description

Deserializes a configuration from a YAML file.

§Arguments

  • filename - Path of the YAML file to read

§Returns

  • Ok(Config) - Successfully parsed configuration
  • Err(MemeaError) - File I/O error or YAML parsing error

§Examples

use std::path::PathBuf;

let config_path = PathBuf::from("config.yaml");
let config = read(&config_path).expect("Failed to read config");