diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..9d72eb5 --- /dev/null +++ b/src/config.rs @@ -0,0 +1,19 @@ +//! Utility config +use crate::streaming_devices::streaming_device::StreamingDevice; +use anyhow::Error; +use serde::Deserialize; +use std::fs; +use std::path::Path; +use toml::from_str; + +#[derive(Deserialize, Debug)] +pub struct Config { + // TODO: implement complete config file + streaming_devices: Vec, +} + +pub fn parse_config_from_toml>(path: P) -> Result { + let toml_content = fs::read_to_string(path).unwrap(); + let config: Config = from_str(&toml_content)?; + Ok(config) +}