scrapyard_core/module/peripheral.rs
1use std::fs::File;
2
3#[derive(Serialize, Deserialize, Debug)]
4pub struct Peripheral {
5 pub name: String,
6 config: String,
7 enabled: bool,
8 configured: bool,
9}
10
11impl Peripheral {
12 pub fn new(name: &str, config: &str) -> Peripheral {
13 Peripheral {
14 name: String::from(name),
15 config: String::from(config),
16 enabled: false,
17 configured: false,
18 }
19 }
20
21 // TODO: Handle error
22 pub fn setup(&self) {
23 let file = File::open(&self.config);
24 }
25}