pub fn from_yaml(yaml: &str) -> Result<Config> {
        let mut docs = YamlLoader::load_from_str(yaml)?;
        ensure!(!docs.is_empty(), QedaError::InvalidConfig);
        let mut json = Self::yaml_to_json(docs.pop().unwrap())?;
        if json == Value::Null {
            json = Value::Object(Map::new());
        }
        Ok(Config { json })
    }
/// Creates a new `Config` from YAML string.
Creates a new `Config` from YAML string.
Creates a new ` Config ` from YAML string .
pub fn from_yaml(yaml: &str) -> Result<Config> {
        let mut docs = YamlLoader::load_from_str(yaml)?;
        ensure!(!docs.is_empty(), QedaError::InvalidConfig);
        let mut json = Self::yaml_to_json(docs.pop().unwrap())?;
        if json == Value::Null {
            json = Value::Object(Map::new());
        }
        Ok(Config { json })
    }
pub fn from_yaml ( yaml : & str ) -> Result < Config > { let mut docs = YamlLoader :: load_from_str ( yaml ) ? ; ensure ! ( docs is_empty ( ) QedaError InvalidConfig ) ; let mut json = Self :: yaml_to_json ( docs . pop ( ) . unwrap ( ) ) ? ; if json == Value :: Null { json = Value :: Object ( Map :: new ( ) ) ; } Ok ( Config { json } ) }
Creates a new `Config` from YAML string.
Creates a new ` Config ` from YAML string .
yaml
&str
yaml
&str