pub async fn from_config(config: &Config) -> Result<Self> {
        let mut lib = Library::new().merged_with_config(config);
        let components_hash = config.get_object("components")?;
        let keys = components_hash.keys();
        for key in keys {
            lib.add_component(key.as_str()).await?; // TODO: Replace awaiting in loop by `join_all` of `JoinHandle`s
        }
        Ok(lib)
    }
// Creates a component library from config.
///
/// # Examples
///
/// ```
/// use qeda::config::Config;
/// use qeda::library::Library;
///
/// let yaml = "
/// components:
///   capacitor/c0603: {}
/// ";
/// let config = Config::from_yaml(yaml).unwrap();
/// let mut rt = tokio::runtime::Runtime::new().unwrap();
/// let lib = rt.block_on(Library::from_config(&config)).unwrap();
///
/// assert_eq!(lib.components.len(), 1);
/// ```
Creates a component library from config.
Creates a component library from config .
pub async fn from_config(config: &Config) -> Result<Self> {
        let mut lib = Library::new().merged_with_config(config);
        let components_hash = config.get_object("components")?;
        let keys = components_hash.keys();
        for key in keys {
            lib.add_component(key.as_str()).await?; // TODO: Replace awaiting in loop by `join_all` of `JoinHandle`s
        }
        Ok(lib)
    }
pub async fn from_config ( config : & Config ) -> Result < Self > { let mut lib = Library :: new ( ) . merged_with_config ( config ) ; let components_hash = config . get_object ( " " ) ? ; let keys = components_hash . keys ( ) ; for key in keys { lib . add_component ( key . as_str ( ) ) . await ? ; // TODO: Replace awaiting in loop by `join_all` of `JoinHandle`s } Ok ( lib ) }
Creates a component library from config.
Creates a component library from config .
config
&Config
config
&Config
examples
```
use qeda::config::Config;
use qeda::library::Library.

let yaml = "
components:
capacitor/c0603: {}
";
let config = Config::from_yaml(yaml).unwrap();
let mut rt = tokio::runtime::Runtime::new().unwrap();
let lib = rt.block_on(Library::from_config(&config)).unwrap().


` ` ` use qeda :: config :: Config ; use qeda :: library :: Library . let yaml = " components : capacitor / c0603 : {} " ; let config = Config :: from_yaml ( yaml ) . unwrap () ; let mut rt = tokio :: runtime :: Runtime :: new () . unwrap () ; let lib = rt . block_on ( Library :: from_config ( &config )) . unwrap () .