mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-09 06:47:59 -06:00
Move modules to individual projects. Change API syntax.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::config::ConfigStructField;
|
||||
|
||||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
|
||||
pub struct Blob {
|
||||
name: String,
|
||||
|
||||
parent_component: String,
|
||||
// parent_runtime: String,
|
||||
config: HashMap<String, ConfigStructField>,
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
mod blob;
|
||||
|
||||
pub use blob::Blob;
|
||||
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
error::Error,
|
||||
@@ -67,7 +71,7 @@ pub struct ComponentState {
|
||||
|
||||
pub fn load_config(path: &PathBuf) -> Result<Vec<ComponentState>, Box<dyn Error>> {
|
||||
let path_absolute = fs::canonicalize(path.clone())?;
|
||||
debug!("Loading data from path: `{}`", path_absolute);
|
||||
debug!("Loading data from path: `{:?}`", path_absolute);
|
||||
|
||||
// Read string as path
|
||||
let config_str = fs::read_to_string(path.clone())?;
|
||||
|
||||
Reference in New Issue
Block a user